public interface ExplorerAction extends PropertyChangeNotifier, SelectedContextAware
The life cycle for an action is:
setSelectedContext(ExplorerContext)
when the job
selection changes.prepare()
before a menu is shown.action()
to perform the action.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DESIGN_GROUP
The name of the 'design' menu group.
|
static java.lang.String |
ENABLED_PROPERTY
The enabled property name.
|
static java.lang.String |
JOB_GROUP
The name of the 'job' menu group.
|
static java.lang.String |
PROPERTY_GROUP
The name of the 'property' menu group.
|
static java.lang.String |
VISIBLE_PROPERTY
The visible property name.
|
Modifier and Type | Method and Description |
---|---|
void |
action()
Called to perform the action.
|
javax.swing.KeyStroke |
getAcceleratorKey()
Get the Accelerator key for the action.
|
java.lang.String |
getGroup()
Get the group name.
|
java.lang.Integer |
getMnemonicKey()
Get the Mnemonic Key for the action.
|
java.lang.String |
getName()
Get the name for the option.
|
boolean |
isEnabled()
Is this action currently enabled?
|
boolean |
isVisible()
Is this action currently visible?
|
void |
prepare()
Called when the Job Menu is selected.
|
void |
setSelectedContext(ExplorerContext eContext)
This method will be called when a component
is selected or unselected.
|
addPropertyChangeListener, removePropertyChangeListener
static final java.lang.String ENABLED_PROPERTY
static final java.lang.String VISIBLE_PROPERTY
static final java.lang.String JOB_GROUP
static final java.lang.String PROPERTY_GROUP
static final java.lang.String DESIGN_GROUP
java.lang.String getName()
java.lang.String getGroup()
java.lang.Integer getMnemonicKey()
javax.swing.KeyStroke getAcceleratorKey()
void setSelectedContext(ExplorerContext eContext)
setSelectedContext
in interface SelectedContextAware
eContext
- the ExplorerContext for the current
node. Null when the node is unselected.void action() throws java.lang.Exception
If this is a FormAction
this method will be called once
the form has been completed. Otherwise this method is called
immediately the menu item or other trigger for the action has
been selected.
java.lang.Exception
- The exception will be caught and
presented to the user.void prepare()
This method was added in addition to
setSelectedContext(ExplorerContext)
because prepare can be
relatively slow if, for instance, it involves ascertaining the state
of a remote job, so this method allows this to be done only when
the menu is to be shown.
prepare
in interface SelectedContextAware
boolean isEnabled()
boolean isVisible()