com.ibm.di.admin
Class DebuggerPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.ibm.di.admin.DebuggerPanel
All Implemented Interfaces:
ActionListener, ItemListener, KeyListener, ImageObserver, MenuContainer, Serializable, Runnable, EventListener, Accessible

public class DebuggerPanel
extends JPanel
implements ActionListener, Runnable, KeyListener, ItemListener

See Also:
Serialized Form

Nested Class Summary
 class DebuggerPanel.CheckedTreeRenderer
          This class renders a checkbox to the left of the tree label.
 class DebuggerPanel.DebuggerBreakpoints
          This panel class contains the breakpoints in table format.
 class DebuggerPanel.DebuggerContextMenu
           
 class DebuggerPanel.DebuggerWatchNode
          This class is the node class used by DebuggerWatchPanel's JTree model.
 class DebuggerPanel.DebuggerWatchPanel
          This class panel shows the watch variables in tree or table format.
 class DebuggerPanel.DebuggerWatchTable
          This class shows watch variables in a table format.
 class DebuggerPanel.MyTree
          Override the getToolTipText to avoid crash as reported in D924
 class DebuggerPanel.UserObject
           
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String STOP_CMD
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DebuggerPanel(ExecuteTask parent, JComponent outputView, String alname)
           
DebuggerPanel(ExecuteTask parent, JComponent outputView, String alname, int port)
           
 
Method Summary
 void actionPerformed(ActionEvent event)
          This method handles user interactions (buttons etc)
 void appendMsg(String msg)
          Appends a message to the "console" log window.
 JComponent centerPanel()
           
 Session connectServer(String server)
          Establish a server connection.
 void createUI()
           
 Object getHost()
          Returns the host address the debugger panel listens for incoming connections.
 int getPort()
          Returns the TCP port number the debugger panel listens for incoming connections.
 TreeModel getTreeModel()
           
 void handleControl(String cmd, DebugMessage msg)
          This method is invoked to handle a debug control message from the remote side.
 boolean isAlPaused()
          Returns true if the remote AssemblyLine is waiting for input
 boolean isAlWaiting()
          Returns true if the remote assemblyline is waiting for the debugger (cont/stop etc)
 boolean isBreakOnError()
          Returns true if the assemblyline is in "break-on-error" mode.
 void itemStateChanged(ItemEvent arg0)
          Listener methods for keyboard input and item selection
 void keyPressed(KeyEvent ke)
           
 void keyReleased(KeyEvent arg0)
           
 void keyTyped(KeyEvent arg0)
           
 void run()
          This is the debugger thread loop that receives messages from the remote side.
 void sendCommand(Object obj)
          This method sends a command to the remote side
 void setBreakOnError(boolean breakOnError)
          Sets the break-on-error flag
 void showWatchVariables()
          This method requests watch variables from the remote side.
 void startDebugger()
          This methods starts the debugger thread that handles communications with the remote debugger client.
 void stopDebugger()
          This methods stops the debugger thread.
 String tick()
          Returns a bracketed string with the current time.
 void updateSplitPanels(boolean hideDebugPanels)
          This method shows/hides the debug panels
 void writeObject(ObjectOutputStream os, Object obj)
          This method is invoked to write an object to the remote side.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STOP_CMD

public static final String STOP_CMD
See Also:
Constant Field Values
Constructor Detail

DebuggerPanel

public DebuggerPanel(ExecuteTask parent,
                     JComponent outputView,
                     String alname)
              throws IOException
Parameters:
parent - The ExecuteTask object running the AL/EH
outputView - The output log view of the running AL/EH
alname - The name of the AL/EH
Throws:
IOException

DebuggerPanel

public DebuggerPanel(ExecuteTask parent,
                     JComponent outputView,
                     String alname,
                     int port)
              throws IOException
Throws:
IOException
Method Detail

createUI

public void createUI()

centerPanel

public JComponent centerPanel()

getTreeModel

public TreeModel getTreeModel()

itemStateChanged

public void itemStateChanged(ItemEvent arg0)
Listener methods for keyboard input and item selection

Specified by:
itemStateChanged in interface ItemListener

keyPressed

public void keyPressed(KeyEvent ke)
Specified by:
keyPressed in interface KeyListener

keyReleased

public void keyReleased(KeyEvent arg0)
Specified by:
keyReleased in interface KeyListener

keyTyped

public void keyTyped(KeyEvent arg0)
Specified by:
keyTyped in interface KeyListener

actionPerformed

public void actionPerformed(ActionEvent event)
This method handles user interactions (buttons etc)

Specified by:
actionPerformed in interface ActionListener

appendMsg

public void appendMsg(String msg)
Appends a message to the "console" log window. A newline is automatically added to the message.

Parameters:
msg - The text to append

tick

public String tick()
Returns a bracketed string with the current time.

Returns:
Returns a bracketed string with the current time.

startDebugger

public void startDebugger()
This methods starts the debugger thread that handles communications with the remote debugger client.


stopDebugger

public void stopDebugger()
This methods stops the debugger thread.


handleControl

public void handleControl(String cmd,
                          DebugMessage msg)
This method is invoked to handle a debug control message from the remote side.

Parameters:
cmd - The command (e.g. swtich, eval etc)
msg - The DebugMessage

sendCommand

public void sendCommand(Object obj)
This method sends a command to the remote side

Parameters:
obj - The command (e.g. quit, cont etc)

showWatchVariables

public void showWatchVariables()
This method requests watch variables from the remote side. The watch values are sent in a separate message.


writeObject

public void writeObject(ObjectOutputStream os,
                        Object obj)
                 throws Exception
This method is invoked to write an object to the remote side. The method is synchronized to prevent the debugger thread and the UI thread to send a message at the same time.

Parameters:
os - The output stream (e.g. connection stream)
obj - The object to send
Throws:
Exception

updateSplitPanels

public void updateSplitPanels(boolean hideDebugPanels)
This method shows/hides the debug panels

Parameters:
hideDebugPanels - true = hide panels

run

public void run()
This is the debugger thread loop that receives messages from the remote side.

Specified by:
run in interface Runnable

connectServer

public Session connectServer(String server)
                      throws Exception
Establish a server connection.

Throws:
Exception

getHost

public Object getHost()
               throws Exception
Returns the host address the debugger panel listens for incoming connections.

Returns:
The IP address in dotted numeric notation
Throws:
Exception

getPort

public int getPort()
Returns the TCP port number the debugger panel listens for incoming connections.

Returns:
The TCP port number

isBreakOnError

public boolean isBreakOnError()
Returns true if the assemblyline is in "break-on-error" mode.

Returns:
the state of the break-on-error flag

setBreakOnError

public void setBreakOnError(boolean breakOnError)
Sets the break-on-error flag

Parameters:
breakOnError - true if assemblyine is running in break-on-error mode

isAlWaiting

public boolean isAlWaiting()
Returns true if the remote assemblyline is waiting for the debugger (cont/stop etc)

Returns:
Returns true if the remote assemblyline is waiting for the debugger (cont/stop etc). Otherwise, false is returned.

isAlPaused

public boolean isAlPaused()
Returns true if the remote AssemblyLine is waiting for input

Returns:
true if the remote AssemblyLine is waiting for input. Otherwise, false is returned.