public abstract class Editor extends javax.swing.JFrame implements RunnerListener
| Modifier and Type | Field and Description |
|---|---|
java.util.ArrayList<ToolContribution> |
contribTools |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSORBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Modifier and Type | Method and Description |
|---|---|
void |
addRecent() |
abstract javax.swing.JMenu |
buildFileMenu() |
abstract javax.swing.JMenu |
buildHelpMenu() |
javax.swing.JMenu |
buildModeMenu()
Override this if you want a special menu for your particular 'mode'.
|
abstract javax.swing.JMenu |
buildSketchMenu() |
void |
clearNotice(java.lang.String msg) |
abstract Formatter |
createFormatter() |
abstract EditorToolbar |
createToolbar() |
abstract void |
deactivateRun() |
Base |
getBase() |
int |
getCaretOffset()
Get the position (character offset) of the caret.
|
abstract java.lang.String |
getCommentPrefix() |
EditorState |
getEditorState() |
int |
getLineCount()
Get the number of lines in the currently displayed buffer.
|
int |
getLineStartOffset(int line)
Get character offset for the start of a given line of text.
|
int |
getLineStopOffset(int line)
Get character offset for end of a given line of text.
|
java.lang.String |
getLineText(int line)
Get text for a specified line.
|
Mode |
getMode() |
javax.swing.JMenu |
getModeMenu() |
int |
getScrollPosition() |
java.lang.String |
getSelectedText()
Called to update the text but not switch to a different set of code
(which would affect the undo manager).
|
int |
getSelectionStart()
Get the beginning point of the current selection.
|
int |
getSelectionStop()
Get the end point of the current selection.
|
Sketch |
getSketch()
Gets the current sketch object.
|
java.awt.Point |
getSketchLocation()
Get the last location of the sketch's run window.
|
java.lang.String |
getText()
Get the contents of the current buffer.
|
java.lang.String |
getText(int start,
int stop)
Get a range of text from the current buffer.
|
JEditTextArea |
getTextArea()
Get the JEditTextArea object for use (not recommended).
|
javax.swing.JMenu |
getToolMenu() |
void |
handleAutoFormat() |
void |
handleCopy()
Implements Edit → Copy.
|
void |
handleCopyAsHTML() |
void |
handleCut()
Implements Edit → Cut.
|
abstract void |
handleImportLibrary(java.lang.String jarPath) |
void |
handleIndent() |
void |
handleIndentOutdent(boolean indent) |
void |
handleOutdent() |
void |
handlePageSetup()
Handler for File → Page Setup.
|
void |
handlePaste()
Implements Edit → Paste.
|
void |
handlePrint()
Handler for File → Print.
|
boolean |
handleSave(boolean immediately)
Actually handle the save command.
|
boolean |
handleSaveAs() |
void |
handleSelectAll()
Implements Edit → Select All.
|
void |
insertText(java.lang.String what) |
abstract void |
internalCloseRunner()
Halt the current runner for whatever reason.
|
boolean |
isHalted() |
boolean |
isSelectionActive()
True if some text is currently selected.
|
void |
prepareRun()
Grab current contents of the sketch window, advance the console,
stop any other running sketches...
|
void |
rebuildToolMenu() |
void |
removeRecent() |
void |
setLineText(int line,
java.lang.String what)
Replace the text on a specified line.
|
void |
setSelectedText(java.lang.String what) |
void |
setSelection(int start,
int stop) |
void |
setSketchLocation(java.awt.Point p)
Set the location of the sketch run window.
|
void |
setText(java.lang.String what)
Replace the entire contents of the front-most tab.
|
static void |
showChanges() |
void |
showReference(java.lang.String filename) |
void |
startCompoundEdit()
Use before a manipulating text to group editing operations together as a
single undo.
|
void |
startIndeterminate() |
void |
statusEmpty()
Clear the status area.
|
void |
statusError(java.lang.Exception e)
Show an exception in the editor status bar.
|
void |
statusError(java.lang.String what)
Show an error in the status bar.
|
void |
statusHalt() |
void |
statusNotice(java.lang.String msg)
Show a notice message in the editor status bar.
|
void |
stopCompoundEdit()
Use with startCompoundEdit() to group edit operations in a single undo.
|
void |
stopIndeterminate() |
void |
updateTitle()
Set the title of the PDE window based on the current sketch, i.e.
|
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, updateaddNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFrontadd, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic java.util.ArrayList<ToolContribution> contribTools
public EditorState getEditorState()
public void removeRecent()
public void addRecent()
public Base getBase()
public Mode getMode()
public javax.swing.JMenu getModeMenu()
public abstract EditorToolbar createToolbar()
public abstract Formatter createFormatter()
public abstract javax.swing.JMenu buildFileMenu()
public abstract javax.swing.JMenu buildSketchMenu()
public abstract void handleImportLibrary(java.lang.String jarPath)
public javax.swing.JMenu getToolMenu()
public void rebuildToolMenu()
public javax.swing.JMenu buildModeMenu()
public abstract javax.swing.JMenu buildHelpMenu()
public void showReference(java.lang.String filename)
public static void showChanges()
public Sketch getSketch()
public JEditTextArea getTextArea()
public java.lang.String getText()
public java.lang.String getText(int start,
int stop)
public void setText(java.lang.String what)
public void insertText(java.lang.String what)
public java.lang.String getSelectedText()
public void setSelectedText(java.lang.String what)
public void setSelection(int start,
int stop)
public int getCaretOffset()
public boolean isSelectionActive()
public int getSelectionStart()
public int getSelectionStop()
public java.lang.String getLineText(int line)
public void setLineText(int line,
java.lang.String what)
public int getLineStartOffset(int line)
public int getLineStopOffset(int line)
public int getLineCount()
public void startCompoundEdit()
public void stopCompoundEdit()
public int getScrollPosition()
public void handleCut()
public void handleCopy()
public void handleCopyAsHTML()
public void handlePaste()
public void handleSelectAll()
public void handleAutoFormat()
public abstract java.lang.String getCommentPrefix()
public void handleIndent()
public void handleOutdent()
public void handleIndentOutdent(boolean indent)
public void setSketchLocation(java.awt.Point p)
public java.awt.Point getSketchLocation()
public void updateTitle()
public boolean handleSave(boolean immediately)
public boolean handleSaveAs()
public void handlePageSetup()
public void handlePrint()
public void prepareRun()
public abstract void internalCloseRunner()
public abstract void deactivateRun()
public void statusError(java.lang.String what)
statusError in interface RunnerListenerpublic void statusError(java.lang.Exception e)
statusError in interface RunnerListenerpublic void statusNotice(java.lang.String msg)
statusNotice in interface RunnerListenerpublic void clearNotice(java.lang.String msg)
public void statusEmpty()
public void startIndeterminate()
startIndeterminate in interface RunnerListenerpublic void stopIndeterminate()
stopIndeterminate in interface RunnerListenerpublic void statusHalt()
statusHalt in interface RunnerListenerpublic boolean isHalted()
isHalted in interface RunnerListener