|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractAction
org.jurvis.swing.actions.JvLongAction
public abstract class JvLongAction
An abstract Action for actions that take a long time. Long
actions shouldn't block the event queue because it makes the application
appear hung (e.g. the screen won't repaint).
Subclasses implement the execute(java.awt.event.ActionEvent) method with the code to perform
the long action. If some setup that must execute on the event thread is
necessary (e.g. prompt the user), subclasses can override the preExecute(java.awt.event.ActionEvent) method. If, after executing the long action, some operations
must be performed on the event thread (e.g. update models), subclasses can
override the postExecute(java.awt.event.ActionEvent, java.lang.Object) method.
| Field Summary |
|---|
| 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 | |
|---|---|
JvLongAction()
Construct a LongAction. |
|
JvLongAction(String name)
Construct a LongAction with the given name. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent event)
Method called when the user invokes this action. |
abstract Object |
execute(ActionEvent e)
Execute the long running action. |
void |
postExecute(ActionEvent e,
Object object)
Perform any operations that must be executed after executing the long action. |
boolean |
preExecute(ActionEvent e)
Perform any operations that must be executed before actually executing the long action. |
| Methods inherited from class javax.swing.AbstractAction |
|---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JvLongAction()
LongAction.
public JvLongAction(String name)
LongAction with the given name.
name - the name of the action| Method Detail |
|---|
public void actionPerformed(ActionEvent event)
event - the invocation eventpublic boolean preExecute(ActionEvent e)
e - the invocation event
execute should be invoked.public abstract Object execute(ActionEvent e)
e - the invocation event
public void postExecute(ActionEvent e,
Object object)
e - the invocation eventobject - the object returned by execute
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||