org.PingOO.DLAI.lib.PWidget
Class PAction

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--org.PingOO.DLAI.lib.PWidget.PAction
Direct Known Subclasses:
Backup.BackupAction, Backup.ExitAction, EditPopupMouseListener.CopyAction, EditPopupMouseListener.CutAction, EditPopupMouseListener.PasteAction, HtmlBrowser.CopyAction, HtmlBrowser.CutAction, HtmlBrowser.GoBackwardAction, HtmlBrowser.GoForwardAction, HtmlBrowser.GoHomeAction, HtmlBrowser.PasteAction, HtmlBrowser.PrintPageAction, MailSM.ExitAction, MailSM.SyncAction, Maintenance.ExitAction, Maintenance.MaintenanceAction, MLM.CopyAction, MLM.CutAction, MLM.DeleteAction, MLM.ListGroupAction, MLM.ListSheetAction, MLM.NewComponentAction, MLM.PasteAction, MLM.PropertiesAction, MLM.SortNodeAction, MLM.SortTreeAction, PPM.StartSlaveAction, PPM.StartToolAction, Shutdown.CancelAction, Shutdown.ExitAction, Shutdown.RebootAction, Shutdown.SelectAllAction, Shutdown.ShutdownAction, UGM.AdministratorAliasAction, UGM.DeleteAction, UGM.ExitAction, UGM.MoveComponentAction, UGM.NewComponentAction, UGM.PrintAction, UGM.PropertiesAction, UGM.ReloadTreeAction, UGM.SaveComponentAction, UGM.SortNodeAction, UGM.SortTreeAction, UGM.UserAliasAction, UGM.UserGroupAction, UGM.UserSheetAction

public abstract class PAction
extends javax.swing.AbstractAction

Defines an action that will use localized resources.
Actions are usefull to provide a single way of handling the same action from two (or more) different sources.
Eg: a popupmenu's menuitem and a toolbar's button can execute the same action, and if the action is disabled the two object will automatically be disbled as well.

Actually PAction can be used with PMenu, PPoppupMenu and PToolBar (as AbstractAction can be used with JMenu, JPopupMenu and JToolBar), it might be extended in the future with an added constructor in PButton, PRadioButton and PToggleButton.

Since:
PingOO 2.0
Version:
2.0
Author:
Fabrice Bouyé (bouye@cur-archamps.fr)
See Also:
AbstractAction, Serialized Form

Field Summary
protected static java.lang.String DEFAULT_MODULE
          Defines the default module where to find this object's text and tool tip.
static java.lang.String MODULE
          Defines the key used to retrieve this object's module.
static java.lang.String TEXT_KEY
          Defines the key used to retrieve this object's text key.
static java.lang.String TOOL_TIP_KEY
          Defines the key used to retrieve this object's tool tip key.
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled, keyTable
 
Constructor Summary
PAction()
          Creates a new action.
PAction(javax.swing.Icon icon)
          Creates a new action.
PAction(javax.swing.Icon icon, java.lang.String toolTipKey)
          Creates a new action.
PAction(javax.swing.Icon icon, java.lang.String toolTipKey, java.lang.String module)
          Creates a new action.
PAction(java.lang.String textKey)
          Creates a new action.
PAction(java.lang.String textKey, javax.swing.Icon icon)
          Creates a new action.
PAction(java.lang.String textKey, java.lang.String toolTipKey, javax.swing.Icon icon)
          Creates a new action.
PAction(java.lang.String textKey, java.lang.String toolTipKey, java.lang.String module, javax.swing.Icon icon)
          Creates a new action.
 
Methods inherited from class javax.swing.AbstractAction
actionPerformed, addPropertyChangeListener, clone, firePropertyChange, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

DEFAULT_MODULE

protected static final java.lang.String DEFAULT_MODULE
Defines the default module where to find this object's text and tool tip.

TEXT_KEY

public static final java.lang.String TEXT_KEY
Defines the key used to retrieve this object's text key.

TOOL_TIP_KEY

public static final java.lang.String TOOL_TIP_KEY
Defines the key used to retrieve this object's tool tip key.

MODULE

public static final java.lang.String MODULE
Defines the key used to retrieve this object's module.
Constructor Detail

PAction

public PAction()
Creates a new action.

PAction

public PAction(java.lang.String textKey)
Creates a new action.
Parameters:
textKey - Used by the targeted components to find their text.

PAction

public PAction(java.lang.String textKey,
               javax.swing.Icon icon)
Creates a new action.
Parameters:
textKey - Used by the targeted components to find their text.
icon - The icon to put on the targeted components.

PAction

public PAction(java.lang.String textKey,
               java.lang.String toolTipKey,
               javax.swing.Icon icon)
Creates a new action.
Parameters:
textKey - Used by the targeted components to find their text.
toolTipKey - Used by the targeted components to find their toolTip.
icon - The icon to put on the targeted components.

PAction

public PAction(javax.swing.Icon icon)
Creates a new action.
Parameters:
icon - The icon to put on the targeted components.

PAction

public PAction(javax.swing.Icon icon,
               java.lang.String toolTipKey)
Creates a new action.
Parameters:
icon - The icon to put on the targeted components.
toolTipKey - Used by the targeted components to find their toolTip.

PAction

public PAction(javax.swing.Icon icon,
               java.lang.String toolTipKey,
               java.lang.String module)
Creates a new action.
Parameters:
icon - The icon to put on the targeted components.
toolTipKey - Used by the targeted components to find their toolTip.
module - Used by the targeted components to find their resources.

PAction

public PAction(java.lang.String textKey,
               java.lang.String toolTipKey,
               java.lang.String module,
               javax.swing.Icon icon)
Creates a new action.
Parameters:
textKey - Used by the targeted components to find their text.
toolTipKey - Used by the targeted components to find their toolTip.
module - Used by the targeted components to find their resources.
icon - The icon to put on the targeted components.