com.bluemarsh.jswat.panel
Class ThreadPanel

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

public class ThreadPanel
extends JSwatPanel
implements VMEventListener, ContextListener

Class ThreadPanel is responsible for displaying a table of threads in the VM.

Author:
Nathan Fiedler

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
ThreadPanel()
          Constructs a new ThreadPanel with the default table.
 
Method Summary
 void activate(Session session)
          Called when the Session is about to begin an active debugging session.
 void close(Session session)
          Called when the Session is closing down this panel, generally just after the panel has been removed from the Session.
 void contextChanged(ContextChangeEvent cce)
          Invoked when the current context has changed.
 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.
 javax.swing.JComponent getPeer()
          Returns a reference to the peer UI component.
protected  com.sun.jdi.ThreadReference getThreadByID(Session session, java.lang.String idToken)
          Finds a thread in the list of all threads whose unique ID number matches that given.
 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.
 void refresh(Session session)
          Update the display on the screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadPanel

public ThreadPanel()
Constructs a new ThreadPanel with the default table.
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.

contextChanged

public void contextChanged(ContextChangeEvent cce)
Invoked when the current context has changed. The context change event identifies which aspect of the context has changed.
Specified by:
contextChanged in interface ContextListener
Parameters:
cce - context change event

close

public void close(Session session)
Called when the Session is closing down this panel, generally just after the panel has been removed from the Session.
Overrides:
close in class JSwatPanel
Parameters:
session - Session closing the panel.

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.

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

getThreadByID

protected com.sun.jdi.ThreadReference getThreadByID(Session session,
                                                    java.lang.String idToken)
                                             throws NoSuchThreadException,
                                                    NotActiveException
Finds a thread in the list of all threads whose unique ID number matches that given. The number is a natural (base 10) ID number, unique for all objects in the debuggee VM.
Parameters:
session - current Session.
idToken - thread ID token.
Returns:
ThreadReference, or null if not found.
Throws:
NoSuchThreadException - Thrown if the thread ID does not match a known thread.
NotActiveException - Thrown if the current session is not active.
java.lang.NumberFormatException - Thrown if the idToken is not a valid number.

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.

refresh

public void refresh(Session session)
Update the display on the screen. Use the given VM to fetch the desired data.
Overrides:
refresh in class JSwatPanel
Parameters:
session - Debugging Session object.