com.bluemarsh.jswat.action
Class JSwatAction

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--com.bluemarsh.jswat.action.JSwatAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable
Direct Known Subclasses:
AboutAction, AddBreakGroupAction, BuildClasspathAction, BuildSourcepathAction, CaptureAction, DefineMacroAction, ExitAction, FindAction, ListBreakAction, OpenFileAction, PreferencesAction, RefreshAction, SetBreakAction, StepAction, VMAttachAction, VMCloseAction, VMListAction, VMResumeAction, VMStartAction, VMStopAction, VMSuspendAction

public abstract class JSwatAction
extends javax.swing.AbstractAction

Base action class which all other actions subclass. Provides some utility functions needed by nearly all of the actions in JSwat.

Author:
Nathan Fiedler
See Also:
Serialized Form

Field Summary
protected static JSwat swat
          Instance of JSwat.
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
JSwatAction(java.lang.String name)
          Creates a new JSwatAction command with the given action command string.
 
Method Summary
static void displayError(java.lang.Object o, java.lang.String msg)
          Display an error message in a dialog.
static java.awt.Frame getFrame(java.lang.Object o)
          Find the hosting frame for this object.
static Session getSession(java.awt.event.ActionEvent e)
          Finds the Session that is associated with the window that contains the component that is the source of the given action event.
 
Methods inherited from class javax.swing.AbstractAction
actionPerformed, addPropertyChangeListener, clone, firePropertyChange, getKeys, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

swat

protected static JSwat swat
Instance of JSwat.
Constructor Detail

JSwatAction

public JSwatAction(java.lang.String name)
Creates a new JSwatAction command with the given action command string.
Parameters:
name - action command string
Method Detail

displayError

public static void displayError(java.lang.Object o,
                                java.lang.String msg)
Display an error message in a dialog.
Parameters:
o - Object with which to find the parent frame. Could be a subclass of EventObject or Component.
msg - error message to be displayed.

getFrame

public static java.awt.Frame getFrame(java.lang.Object o)
Find the hosting frame for this object. Often used when displaying dialogs which require a host frame.
Parameters:
o - Object with which to find the parent frame. Could be a subclass of EventObject or Component.
Returns:
hosting frame or null if none.

getSession

public static Session getSession(java.awt.event.ActionEvent e)
Finds the Session that is associated with the window that contains the component that is the source of the given action event.
Parameters:
e - action event with which to find Session.
Returns:
Session instance, or null if error.