com.bluemarsh.jswat.panel
Class ClassPanel

java.lang.Object
  |
  +--com.bluemarsh.jswat.panel.JSwatPanel
        |
        +--com.bluemarsh.jswat.panel.ClassPanel
All Implemented Interfaces:
java.util.EventListener, java.lang.Runnable, SessionListener, VMEventListener

public class ClassPanel
extends JSwatPanel
implements java.lang.Runnable, VMEventListener

Class ClassPanel is responsible for displaying a class tree in a navigable tree component.

Author:
Nathan Fiedler

Field Summary
protected  boolean awaitingUpdate
          True if panel is waiting to be called by AWT event thread in order to update the panel.
protected  java.lang.String defaultRootName
          Default root node name.
protected  com.sun.jdi.request.ClassPrepareRequest prepareRequest
          Class prepare request we created.
protected  Session session
          Session that owns us.
protected  com.bluemarsh.jswat.panel.ClassPanel.ClassTree tree
          Tree that displays classes.
protected  com.bluemarsh.jswat.panel.ClassPanel.ClassTreeModel treeModel
          Class tree data model.
protected  javax.swing.JScrollPane uicomp
          Our UI component - scrollable pane.
protected  com.sun.jdi.request.ClassUnloadRequest unloadRequest
          Class unload request we created.
 
Fields inherited from class com.bluemarsh.jswat.panel.JSwatPanel
swat
 
Fields inherited from interface com.bluemarsh.jswat.event.VMEventListener
PRIORITY_BREAKPOINT, PRIORITY_DEFAULT, PRIORITY_HIGH, PRIORITY_HIGHEST, PRIORITY_LOW, PRIORITY_LOWEST, PRIORITY_SESSION
 
Constructor Summary
ClassPanel()
          Constructs a new ClassPanel with the default tree.
 
Method Summary
 void activate(Session session)
          Called when the Session is about to begin an active debugging session.
protected  void buildTree(com.sun.jdi.VirtualMachine vm)
          Builds out the class tree.
 void deactivate(Session session)
          Called when the Session is about to end an active debugging session.
 boolean eventOccurred(com.sun.jdi.event.Event e)
          Invoked when a VM event has occurred.
static java.lang.String getPathName(javax.swing.tree.TreePath tpath)
          Converts the TreePath into a String object using the user object names of the path nodes.
 javax.swing.JComponent getPeer()
          Returns a reference to the peer UI component.
 javax.swing.JComponent getUI()
          Returns a reference to the UI component.
 void init(Session session)
          Called when the Session is ready to initialize this panel, generally just after the panel has been added to the Session.
protected  void pathSelected(javax.swing.tree.TreePath tpath)
          Called whenever a node in the tree has been double-clicked on.
 void run()
          Builds the class tree from scratch.
 
Methods inherited from class com.bluemarsh.jswat.panel.JSwatPanel
close, refresh
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tree

protected com.bluemarsh.jswat.panel.ClassPanel.ClassTree tree
Tree that displays classes.

uicomp

protected javax.swing.JScrollPane uicomp
Our UI component - scrollable pane.

defaultRootName

protected java.lang.String defaultRootName
Default root node name.

treeModel

protected com.bluemarsh.jswat.panel.ClassPanel.ClassTreeModel treeModel
Class tree data model. Holds all the elements of the tree.

session

protected Session session
Session that owns us.

prepareRequest

protected com.sun.jdi.request.ClassPrepareRequest prepareRequest
Class prepare request we created.

unloadRequest

protected com.sun.jdi.request.ClassUnloadRequest unloadRequest
Class unload request we created.

awaitingUpdate

protected volatile boolean awaitingUpdate
True if panel is waiting to be called by AWT event thread in order to update the panel.
Constructor Detail

ClassPanel

public ClassPanel()
Constructs a new ClassPanel with the default tree.
Method Detail

activate

public void activate(Session session)
Called when the Session is about to begin an active debugging session. That is, JSwat is about to debug a debuggee VM. Panels are not activated in any particular order.
Overrides:
activate in class JSwatPanel
Parameters:
session - Session being activated.

buildTree

protected void buildTree(com.sun.jdi.VirtualMachine vm)
Builds out the class tree.
Parameters:
vm - Virtual machine, or null if deactivating.

deactivate

public void deactivate(Session session)
Called when the Session is about to end an active debugging session. That is, JSwat is about to terminate the connection with the debuggee VM. Panels are not deactivated in any particular order.
Overrides:
deactivate in class JSwatPanel
Parameters:
session - Session being deactivated.

eventOccurred

public boolean eventOccurred(com.sun.jdi.event.Event e)
Invoked when a VM event has occurred.
Specified by:
eventOccurred in interface VMEventListener
Parameters:
e - VM event
Returns:
true if debuggee VM should be resumed, false otherwise.

getPathName

public static java.lang.String getPathName(javax.swing.tree.TreePath tpath)
Converts the TreePath into a String object using the user object names of the path nodes. Only works on leaf nodes.
Parameters:
tpath - TreePath
Returns:
Name of user objects in tree path, separated by periods, or null if path does not denote a leaf node.

getPeer

public javax.swing.JComponent getPeer()
Returns a reference to the peer UI component. In many cases this is a JList, JTree, or JTable, depending on the type of data being displayed in the panel.
Returns:
peer ui component object

getUI

public javax.swing.JComponent getUI()
Returns a reference to the UI component.
Overrides:
getUI in class JSwatPanel
Returns:
ui component object

init

public void init(Session session)
Called when the Session is ready to initialize this panel, generally just after the panel has been added to the Session.
Overrides:
init in class JSwatPanel
Parameters:
session - Session initializing this panel.

pathSelected

protected void pathSelected(javax.swing.tree.TreePath tpath)
Called whenever a node in the tree has been double-clicked on.
Parameters:
tpath - TreePath.

run

public void run()
Builds the class tree from scratch.
Specified by:
run in interface java.lang.Runnable