public class JavaEditor extends Editor
JFrame.AccessibleJFrameFrame.AccessibleAWTFrameWindow.AccessibleAWTWindow, Window.TypeContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
String[] |
baseCode |
protected List<LineHighlight> |
breakpointedLines |
protected String |
breakpointMarkerComment |
protected LineHighlight |
currentLine |
protected boolean |
debugEnabled |
protected Debugger |
debugger |
protected JMenuItem |
debugItem |
protected JMenu |
debugMenu |
protected VariableInspector |
inspector |
protected JMenuItem |
inspectorItem |
protected PDEX |
pdex |
protected PreprocessingService |
preprocessingService |
base, console, copyAction, copyAsHtmlAction, cutAction, editMenuUpdatable, EMPTY, errorColumn, errorTable, footer, GUTTER_MARGIN, header, LEFT_GUTTER, mode, pasteAction, problems, redoAction, RIGHT_GUTTER, sketch, splitPane, state, status, textarea, toolbar, undoActionaccessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabledCROSSHAIR_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_ALIGNMENTDISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSEABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Modifier | Constructor and Description |
|---|---|
protected |
JavaEditor(Base base,
String path,
EditorState state,
Mode mode) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activateContinue() |
protected void |
activateDebug() |
protected void |
activateRun() |
protected void |
activateStep() |
protected void |
addBreakpointComments(String tabFilename)
Add breakpoint marker comments to the source file of a specific tab.
|
void |
addBreakpointedLine(LineID lineID)
Add highlight for a breakpointed line.
|
protected void |
applyPreferences() |
protected boolean |
automateSketch(Sketch sketch,
SketchParser parser)
Replace all numbers with variables and add code to initialize
these variables and handle update messages.
|
protected void |
autoSave()
Displays a JDialog prompting the user to save when the user hits
run/present/etc.
|
protected JMenu |
buildDebugMenu()
Creates the debug menu.
|
JMenu |
buildFileMenu() |
JMenu |
buildHelpMenu() |
JMenu |
buildModeMenu() |
JMenu |
buildSketchMenu() |
void |
clearBreakpointedLines()
Remove all highlights for breakpointed lines.
|
void |
clearConsole() |
void |
clearCurrentLine()
Clear the highlight for the debuggers current line.
|
void |
clearSelection() |
void |
codeFolderChanged() |
EditorFooter |
createFooter() |
Formatter |
createFormatter() |
EditorHeader |
createHeader() |
PdePreprocessor |
createPreprocessor(String sketchName) |
protected JEditTextArea |
createTextArea() |
EditorToolbar |
createToolbar() |
Document |
currentDocument()
Access the currently edited document.
|
void |
cursorToLineEnd(int lineIdx)
Set the cursor to the end of a line.
|
void |
cursorToLineStart(int lineIdx)
Set the cursor to the start of a line.
|
protected void |
deactivateContinue() |
protected void |
deactivateDebug() |
void |
deactivateRun()
Deactivate the Run button.
|
protected void |
deactivateStep() |
void |
dispose()
Used instead of the windowClosing event handler, since it's not called on
mode switch.
|
protected void |
downloadImports()
Downloads libraries that have been imported, that aren't available as a
LocalContribution, but that have an AvailableContribution associated with
them.
|
void |
errorTableDoubleClick(Object item) |
protected boolean |
exportApplicationPrompt() |
String |
getCommentPrefix() |
protected LineID |
getCurrentLineID()
Retrieve line of sketch where the cursor currently resides.
|
SketchCode |
getCurrentTab()
Retrieve the current tab.
|
Debugger |
getDebugger() |
JavaTextArea |
getJavaTextArea()
Access the custom text area object.
|
LineID |
getLineIDInCurrentTab(int lineIdx)
Retrieve a
LineID object for a line on the current tab. |
PreprocessingService |
getPreprocessingService() |
SketchCode |
getTab(String filename)
Get a tab by its file name.
|
void |
handleContinue() |
void |
handleExportApplication()
Handler for Sketch → Export Application
|
protected boolean |
handleExportCheckModified()
Checks to see if the sketch has been modified, and if so,
asks the user to save the sketch or cancel the export.
|
void |
handleImportLibrary(String libraryName)
Add import statements to the current tab for all of packages inside
the specified jar file.
|
protected void |
handleLaunch(boolean present,
boolean tweak) |
void |
handlePresent() |
void |
handleRun() |
boolean |
handleSave(boolean immediately) |
boolean |
handleSaveAs() |
void |
handleStep(int modifiers) |
void |
handleStop()
Event handler called when hitting the stop button.
|
void |
handleTweak() |
boolean |
hasJavaTabs() |
protected void |
initBaseCode() |
protected void |
initEditorCode(List<List<Handle>> handles,
boolean withSpaces) |
void |
internalCloseRunner() |
boolean |
isDebuggerEnabled() |
boolean |
isInCurrentTab(LineID line)
Check whether a
LineID is on the current tab. |
void |
librariesChanged() |
void |
onRunnerExiting(Runner runner) |
void |
prepareRun()
Grab current contents of the sketch window, advance the console, stop any
other running sketches, auto-save the user's code... not in that order.
|
void |
removeBreakpointedLine(int lineIdx)
Remove a highlight for a breakpointed line.
|
void |
selectLine(int lineIdx)
Select a line in the current tab.
|
void |
setCode(SketchCode code)
Event handler called when switching between tabs.
|
void |
setCurrentLine(LineID line)
Set the line to highlight as currently suspended at.
|
protected void |
setTabContents(String tabFilename,
String code)
Set text contents of a specific tab.
|
void |
sketchChanged() |
protected void |
startTweakMode() |
void |
statusBusy() |
void |
statusError(String what) |
void |
statusHalted() |
protected void |
stopTweakMode(List<List<Handle>> handles) |
protected List<LineID> |
stripBreakpointComments()
Extract breakpointed lines from source code marker comments.
|
void |
switchToTab(String tabFileName)
Switch to a tab.
|
void |
toggleBreakpoint(int lineIndex) |
void |
toggleDebug() |
void |
updateErrorTable(List<Problem> problems)
Updates the error table in the Error Window.
|
protected void |
updateExportButton() |
protected void |
updateInterface(List<List<Handle>> handles,
List<List<ColorControlBox>> colorBoxes) |
VariableInspector |
variableInspector()
Access variable inspector window.
|
addErrorTable, buildEditMenu, buildFileMenu, buildMenuBar, buildSketchMenu, checkModified, checkParen, clearNotice, clearToolMenu, errorTableClick, findProblems, functionable, getBase, getCaretOffset, getConsole, getDividerLocation, getEditorState, getErrorTable, getLineCount, getLineStartOffset, getLineStopOffset, getLineText, getMode, getModePopup, getPdeTextArea, getProblems, getScrollPosition, getSelectedText, getSelectionStart, getSelectionStop, getSketch, getSketchLocation, getStatusMessage, getStatusMode, getText, getText, getTextArea, getToolMenu, handleAutoFormat, handleCommentUncomment, handleCopy, handleCopyAsHTML, handleCut, handleFindReference, handleIndent, handleIndentOutdent, handleOpenInternal, handleOutdent, handlePageSetup, handlePaste, handlePrint, handleSaveImpl, handleSelectAll, highlight, highlight, insertText, isHalted, isSelectionActive, rebuildHeader, rebuildModePopup, rebuildToolbar, referenceCheck, removeNotify, repaintErrorBar, repaintHeader, setDividerLocation, setLineText, setProblemList, setSelectedText, setSelectedText, setSelection, setSketchLocation, setText, setUpdatesAvailable, showChanges, showConsole, showReference, showReferenceFile, startCompoundEdit, startIndeterminate, statusEmpty, statusError, statusHalt, statusMessage, statusNotice, statusToolTip, stopCompoundEdit, stopIndeterminate, updateEditorStatus, updateErrorToggle, updateTitleaddImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateaddNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, 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, processEvent, processWindowFocusEvent, processWindowStateEvent, 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, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFont, postEventprotected final List<LineHighlight> breakpointedLines
protected LineHighlight currentLine
protected final String breakpointMarkerComment
protected JMenu debugMenu
protected JMenuItem debugItem
protected Debugger debugger
protected boolean debugEnabled
protected VariableInspector inspector
protected JMenuItem inspectorItem
protected PreprocessingService preprocessingService
protected PDEX pdex
public String[] baseCode
protected JavaEditor(Base base, String path, EditorState state, Mode mode) throws EditorException
EditorExceptionpublic PdePreprocessor createPreprocessor(String sketchName)
protected JEditTextArea createTextArea()
createTextArea in class Editorpublic EditorToolbar createToolbar()
createToolbar in class Editorpublic EditorHeader createHeader()
createHeader in class Editorpublic EditorFooter createFooter()
createFooter in class Editorpublic Formatter createFormatter()
createFormatter in class Editorpublic JMenu buildFileMenu()
buildFileMenu in class Editorpublic JMenu buildSketchMenu()
buildSketchMenu in class Editorpublic JMenu buildHelpMenu()
buildHelpMenu in class Editorpublic String getCommentPrefix()
getCommentPrefix in class Editorpublic void handleExportApplication()
protected void updateExportButton()
protected boolean exportApplicationPrompt()
throws IOException,
SketchException
IOExceptionSketchExceptionprotected boolean handleExportCheckModified()
public void handleRun()
public void handlePresent()
public void handleTweak()
protected void handleLaunch(boolean present,
boolean tweak)
public void handleStop()
public void handleStep(int modifiers)
public void handleContinue()
public void onRunnerExiting(Runner runner)
public void toggleBreakpoint(int lineIndex)
toggleBreakpoint in class Editorpublic boolean handleSaveAs()
handleSaveAs in class Editorpublic void handleImportLibrary(String libraryName)
handleImportLibrary in class Editorpublic void librariesChanged()
librariesChanged in class Editorpublic void codeFolderChanged()
codeFolderChanged in class Editorpublic void sketchChanged()
sketchChanged in class Editorpublic void statusError(String what)
statusError in interface RunnerListenerstatusError in class Editorpublic void internalCloseRunner()
internalCloseRunner in class Editorpublic void dispose()
protected JMenu buildDebugMenu()
public boolean isDebuggerEnabled()
isDebuggerEnabled in class Editorpublic JMenu buildModeMenu()
buildModeMenu in class Editorprotected List<LineID> stripBreakpointComments()
LineIDs where breakpoint marker comments were
removed from.protected void addBreakpointComments(String tabFilename)
tabFilename - the tab file namepublic boolean handleSave(boolean immediately)
handleSave in class Editorprotected void setTabContents(String tabFilename, String code)
tabFilename - the tab file namecode - the text to setpublic void clearConsole()
public void clearSelection()
public void selectLine(int lineIdx)
lineIdx - 0-based line numberpublic void cursorToLineStart(int lineIdx)
lineIdx - 0-based line numberpublic void cursorToLineEnd(int lineIdx)
lineIdx - 0-based line numberpublic void switchToTab(String tabFileName)
tabFileName - the file name identifying the tab. (as in
SketchCode.getFileName())public Debugger getDebugger()
public JavaTextArea getJavaTextArea()
public PreprocessingService getPreprocessingService()
public void prepareRun()
prepareRun in class Editorprotected void downloadImports()
protected void autoSave()
public VariableInspector variableInspector()
protected void activateRun()
public void deactivateRun()
deactivateRun in class Editorprotected void activateDebug()
protected void deactivateDebug()
protected void activateContinue()
protected void deactivateContinue()
protected void activateStep()
protected void deactivateStep()
public void toggleDebug()
public void setCurrentLine(LineID line)
line - the line to highlight as current suspended linepublic void clearCurrentLine()
public void addBreakpointedLine(LineID lineID)
lineID - the line id to highlight as breakpointedpublic void removeBreakpointedLine(int lineIdx)
lineIdx - the line index on the current tab to remove a breakpoint
highlight frompublic void clearBreakpointedLines()
public LineID getLineIDInCurrentTab(int lineIdx)
LineID object for a line on the current tab.lineIdx - the line index on the current tabLineID object representing a line index on the
current tabprotected LineID getCurrentLineID()
LineIDpublic boolean isInCurrentTab(LineID line)
LineID is on the current tab.public void setCode(SketchCode code)
public SketchCode getTab(String filename)
filename - the filename to search for.SketchCode object for the tab, or null if not foundpublic SketchCode getCurrentTab()
SketchCode representing the current tabpublic Document currentDocument()
public void statusBusy()
public void statusHalted()
public void updateErrorTable(List<Problem> problems)
updateErrorTable in class Editorpublic void errorTableDoubleClick(Object item)
errorTableDoubleClick in class Editorpublic boolean hasJavaTabs()
protected void applyPreferences()
applyPreferences in class Editorprotected void startTweakMode()
protected void updateInterface(List<List<Handle>> handles, List<List<ColorControlBox>> colorBoxes)
protected void initBaseCode()
protected boolean automateSketch(Sketch sketch, SketchParser parser)
Copyright © 2001–2017 Processing Foundation. All rights reserved.