public abstract class PFCAction extends AbstractAction
PFCAction is configured by a set of properties. See section PJF AppCenter FnS section 4.7.1 for the properties definitions. (We'll move it here later.)
Modifier and Type | Field and Description |
---|---|
static String |
ACCEL
Constant used to store accelerator property information in the action class.
|
static String |
ICON_DISABLED
Constant used to store icon disabled information in action class
|
static String |
ICON_PRESSED
Constant used to store icon property information in the action class.
|
static String |
MNEM
Constant used to store mnemonic property information in the action class.
|
static String |
RES_ACCEL
Suffix of the token that defines the action accelerator in the resource file.
|
static String |
RES_DESCRIPTION
Suffix of the token that defines the action description in the resource file.
|
static String |
RES_ICON
Suffix of the token that defines the action icon in the resource file.
|
static String |
RES_ICON_DISABLED
Suffix of the token that defines the action disabled icon in the resource file.
|
static String |
RES_ICON_PRESSED
Suffix of the token that defines the action pressed icon in the resource file.
|
static String |
RES_MNEM
Suffix of the token that defines the action mnemonic in the resource file.
|
static String |
RES_NAME
Suffix of the token that defines the name in the resource file.
|
static String |
RES_TOOLBAR_LABEL
Suffix of the token that defines the action toolbar label in the resource file.
|
static String |
RES_TOOLTIP
Suffix of the token that defines the action tooltip in the resource file.
|
static String |
RES_TYPE
Suffix of the token that defines the action type in the resource file.
|
static String |
TOOLBAR_LABEL
Constant used to indicate the label that should appear for a toolbar
button.
|
static String |
TYPE
Constant used to store type information in action class
|
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
PFCAction()
Zero-arg constructor that does no initialization.
|
PFCAction(String token,
Properties props,
ResourceBundle resbndl)
Creates a PFCAction.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
actionPerformed(ActionEvent ae)
Override this method to implement the functionality
that this action provides.
|
Component |
getCustomToolbarComponent()
Override this method to return a custom control when this action
is used in a toolbar.
|
String |
getToken() |
boolean |
isConfigured()
Check if this action is configured.
|
void |
setConfigured(boolean configured)
Sets the configured property for the action.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public static final String ACCEL
public static final String RES_ACCEL
public static final String MNEM
public static final String RES_MNEM
public static final String ICON_DISABLED
public static final String RES_ICON_DISABLED
public static final String ICON_PRESSED
public static final String RES_ICON_PRESSED
public static final String TOOLBAR_LABEL
public static final String RES_TOOLBAR_LABEL
public static final String RES_NAME
public static final String RES_TOOLTIP
public static final String RES_DESCRIPTION
public static final String RES_ICON
public static final String TYPE
public static final String RES_TYPE
public PFCAction()
public PFCAction(String token, Properties props, ResourceBundle resbndl)
token
- Action token of the form
<appname>.action.<actiontoken>. Must not be null.props
- Properties object that contains action definitions.
Must not be null.resbndl
- Contains action resources for name, icon, accelerator,
etc. Must not be null.public String getToken()
public void setConfigured(boolean configured)
An action should check in its constructor whether it should be available to the user and set this value as appropriate. An action should not be available (configured == false) if some dependency required by the action is not present.
'Un/Configured' should not be confused with 'En/Disabled'. Disabled actions are visible on the toolbar/menubar but are inactive. Unconfigured actions do not even show up.
configured
- Specifies whether the action should be available to
the user on the menubar and toolbar. Should be set in the
action constructor. Defaults to 'true'.public boolean isConfigured()
public Component getCustomToolbarComponent()
public abstract void actionPerformed(ActionEvent ae)
Copyright © 2003, 2023, Oracle and/or its affiliates.