public class SwingDebugScriptWindow extends AbstractSwingScriptLogger implements ScriptExceptionListener, DebugListener, javax.swing.event.TreeExpansionListener
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTINUE_TOOLTIP
The key for the continue tooltip.
|
static java.lang.String |
END_TOOLTIP
The key for the end tooltip.
|
static java.lang.String |
STEP_TOOLTIP
The key for the step tooltip.
|
area, progressBar
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
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_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
STATE_ABORTED, STATE_ERROR, STATE_OK
CLEAR_KEY, OK_KEY, PRINT_KEY, SEARCH_KEY
Constructor and Description |
---|
SwingDebugScriptWindow()
Constructor with a default title and size.
|
SwingDebugScriptWindow(int editorRows,
int areaRows)
Constructor with a default title.
|
SwingDebugScriptWindow(java.lang.String title,
int editorRows,
int areaRows)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
aborted(java.lang.String message)
Fired when an abort is encountered.
|
boolean |
addBreakpoint(int lineNumber)
Add a breakpoint for a line number, or change the breakpoint to a step.
|
void |
addDebugSession(DebugSession<?> session)
Set the debug session.
|
void |
editBreakpoint(Breakpoint breakpoint,
java.lang.String expressionAsString)
Edit a breakpoint for a line number.
|
void |
endSession()
Called when the session has ended.
|
java.util.Map<java.lang.Integer,Breakpoint> |
getBreakpoints()
Return the breakpoints.
|
java.util.Set<java.lang.Integer> |
getBrokens()
Return the line numbers for broken breakpoints.
|
int |
getCurrentStep()
Return the current line.
|
short |
getScriptState()
Return the state of the listener since the last execution.
|
protected java.lang.String |
getTooltip(java.lang.String key)
Return the tooltip for the button defined by a specified key.
|
protected void |
init()
Initialize the window.
|
protected void |
initializeHTMLContent()
Initialize the HTML content.
|
void |
installScript(ScriptSource source,
ScriptWrapper wrapper)
Called when a script is installed.
|
boolean |
isScriptInstalled(ScriptSource source)
Return true if the script associated with a specified source has already been installed.
|
void |
notified(java.lang.String message,
char errorType,
java.lang.Throwable th)
Fired when any exception is encountered.
|
void |
notifiedFirst(ScriptRuntimeException exception,
char errorType,
java.lang.String extension)
Fired when the first exception is encountered while executing a script.
|
void |
resetState()
Reset the state of the script listener.
|
void |
setScriptLogger(ScriptLogger logger)
Set the script logger.
|
void |
step(DebugSession<?> session,
Step step)
Apply a step.
|
void |
treeCollapsed(javax.swing.event.TreeExpansionEvent event) |
void |
treeExpanded(javax.swing.event.TreeExpansionEvent event) |
protected void |
visitHyperLink(java.lang.String linkDesc)
Visit an hyperlink.
|
acceptNullObjectLinks, append, append, appendArrayLinks, appendColorArrayLinks, appendError, appendLink, appendLink, appendLinks, appendObjectLink, appendObjectLink, appendObjectLinks, appendObjectLinks, appendObjectLinks, clear, clearTab, createYesNoPanel, doPrint, doPrintImpl, getHyperLinkListener, getLines, getLinkIndexConverter, getPrintDirectory, getTab, initializeTextArea, registerHyperLinkListener, registerLinkIndexConverter, setProgress, setTab
addImpl, 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, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, 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, 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, toFront
add, 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, validateTree
action, 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, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
resetWrapperOnDispose
doGetLabel, getLabel
appendError, appendLinks, appendObjectLinks, appendStackTrace, finishedScript
public static final java.lang.String STEP_TOOLTIP
public static final java.lang.String CONTINUE_TOOLTIP
public static final java.lang.String END_TOOLTIP
public SwingDebugScriptWindow()
public SwingDebugScriptWindow(int editorRows, int areaRows)
editorRows
- the number of rows for the editorareaRows
- the number of rows for the output and variables areapublic SwingDebugScriptWindow(java.lang.String title, int editorRows, int areaRows)
title
- the window titleeditorRows
- the number of rows for the editorareaRows
- the number of rows for the output and variables areapublic int getCurrentStep()
public java.util.Map<java.lang.Integer,Breakpoint> getBreakpoints()
public java.util.Set<java.lang.Integer> getBrokens()
public void editBreakpoint(Breakpoint breakpoint, java.lang.String expressionAsString)
breakpoint
- the breakpointexpressionAsString
- the expression to use for the breakpointpublic boolean addBreakpoint(int lineNumber)
lineNumber
- the line numberpublic void setScriptLogger(ScriptLogger logger)
setScriptLogger
in interface ScriptExceptionListener
logger
- the script loggerpublic void installScript(ScriptSource source, ScriptWrapper wrapper)
installScript
in interface DebugListener
source
- the script sourcewrapper
- the ScriptWrapperpublic boolean isScriptInstalled(ScriptSource source)
isScriptInstalled
in interface DebugListener
source
- the sourcepublic short getScriptState()
getScriptState
in interface ScriptExceptionListener
public void aborted(java.lang.String message)
aborted
in interface ScriptExceptionListener
message
- the abort messagepublic void notified(java.lang.String message, char errorType, java.lang.Throwable th)
notified
in interface ScriptExceptionListener
message
- the messageth
- the ThrowableerrorType
- the error typeErrorType
public void notifiedFirst(ScriptRuntimeException exception, char errorType, java.lang.String extension)
notifiedFirst
in interface ScriptExceptionListener
exception
- the ScriptExceptionextension
- the language extensionerrorType
- the error typeErrorType
public void resetState()
resetState
in interface ScriptExceptionListener
public void endSession()
endSession
in interface DebugListener
public void addDebugSession(DebugSession<?> session)
addDebugSession
in interface DebugListener
session
- the debug sessionpublic void step(DebugSession<?> session, Step step)
step
in interface DebugListener
session
- the Debug sessionstep
- the steppublic void treeExpanded(javax.swing.event.TreeExpansionEvent event)
treeExpanded
in interface javax.swing.event.TreeExpansionListener
public void treeCollapsed(javax.swing.event.TreeExpansionEvent event)
treeCollapsed
in interface javax.swing.event.TreeExpansionListener
protected java.lang.String getTooltip(java.lang.String key)
key
- the keyprotected void initializeHTMLContent()
initializeHTMLContent
in class AbstractSwingScriptLogger
protected void visitHyperLink(java.lang.String linkDesc)
visitHyperLink
in class AbstractSwingScriptLogger
linkDesc
- the hyperlink descriptionprotected void init()
init
in class AbstractSwingScriptLogger
Copyright © 2019-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence