public abstract class JobAction extends java.lang.Object implements ExplorerAction
DESIGN_GROUP, ENABLED_PROPERTY, JOB_GROUP, PROPERTY_GROUP, VISIBLE_PROPERTY
Constructor and Description |
---|
JobAction() |
Modifier and Type | Method and Description |
---|---|
void |
action()
Called to perform the action.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a Listener.
|
protected boolean |
checkPrepare() |
protected abstract void |
doAction() |
protected void |
doFree(ExplorerContext explorerContext) |
protected void |
doPrepare(ExplorerContext explorerContext) |
protected ExplorerContext |
getExplorerContext() |
boolean |
isEnabled()
Is this action currently enabled?
|
protected boolean |
isPrepared() |
boolean |
isVisible()
Is this action currently visible?
|
void |
prepare()
Called when the Job Menu is selected.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a Listener.
|
protected void |
setEnabled(boolean enabled) |
void |
setSelectedContext(ExplorerContext explorerContext)
This method will be called when a component
is selected or unselected.
|
protected void |
setVisible(boolean visible) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAcceleratorKey, getGroup, getMnemonicKey, getName
public final boolean isEnabled()
isEnabled
in interface ExplorerAction
protected void setEnabled(boolean enabled)
public final boolean isVisible()
ExplorerAction
isVisible
in interface ExplorerAction
protected void setVisible(boolean visible)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeNotifier
addPropertyChangeListener
in interface PropertyChangeNotifier
listener
- The listener.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeNotifier
removePropertyChangeListener
in interface PropertyChangeNotifier
listener
- The listener.public final void setSelectedContext(ExplorerContext explorerContext)
ExplorerAction
setSelectedContext
in interface ExplorerAction
setSelectedContext
in interface SelectedContextAware
explorerContext
- the ExplorerContext for the current
node. Null when the node is unselected.public final void prepare()
ExplorerAction
This method was added in addition to
ExplorerAction.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 ExplorerAction
prepare
in interface SelectedContextAware
protected ExplorerContext getExplorerContext()
protected boolean isPrepared()
protected abstract void doAction() throws java.lang.Exception
java.lang.Exception
protected final boolean checkPrepare()
public final void action() throws java.lang.Exception
ExplorerAction
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.
action
in interface ExplorerAction
java.lang.Exception
- The exception will be caught and
presented to the user.protected void doPrepare(ExplorerContext explorerContext)
protected void doFree(ExplorerContext explorerContext)