|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.gui.ActionWrapper
edu.neu.ccs.gui.DialogAction
Encapsulates an Action that will be performed
for a GeneralDialog.
| Field Summary | |
static Object |
AUTO_CLOSE
The choice to auto close the dialog after the action. |
protected GeneralDialog |
dialog
The dialog to act on. |
protected Object |
finish
The last action to perform. |
static Object |
KEEP_OPEN
The choice to keep the dialog open after the action. |
static Object |
SET_CANCEL
The choice to both close the dialog and mark the dialog as cancelled. |
| Fields inherited from class edu.neu.ccs.gui.ActionWrapper |
action |
| Fields inherited from interface edu.neu.ccs.console.ConsoleAware |
console |
| Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
| Constructor Summary | |
DialogAction(GeneralDialog dialog,
Action action,
Object finish)
Constructs a DialogAction object using
a GeneralDialog object,
an action that must be performed for that dialog,
and an object that determines what will happen to
the dialog when the action is done. |
|
DialogAction(GeneralDialog dialog,
Object[] actionData)
Constructs a DialogAction object using
a GeneralDialog object and
an action data array to set the action and finish. |
|
DialogAction(GeneralDialog dialog,
String name,
Icon icon,
Object finish)
Constructs a DialogAction object using
a GeneralDialog object,
a name and icon to define a trivial action,
and an object that determines what will happen to
the dialog when the action is done. |
|
DialogAction(GeneralDialog dialog,
String name,
Object finish)
Constructs a DialogAction object using
a GeneralDialog object,
a name to define a trivial action,
and an object that determines what will happen to
the dialog when the action is done. |
|
| Method Summary | |
void |
actionPerformed(ActionEvent event)
Invokes the actionPerformed method of the
encapsulated action and then performs the action
specified as the finish action. |
Object |
getFinish()
Returns the choice of what to do to the dialog when the action is done. |
static DialogAction |
makeDialogAction(GeneralDialog dialog,
Object[] actionData)
|
static DialogAction[] |
makeDialogActions(GeneralDialog dialog,
Object[][] actionData)
|
static Action |
makeTrivialAction(String name)
Returns an action with the given name that does no work. |
static Action |
makeTrivialAction(String name,
Icon icon)
Returns an action with the given name and icon that does no work. |
void |
setActionAndFinish(Object[] actionData)
|
void |
setFinish(Object finish)
Sets the choice of what to do to the dialog when the action is done to the given parameter. |
| Methods inherited from class edu.neu.ccs.gui.ActionWrapper |
addPropertyChangeListener, getAction, getBaseAction, getName, getValue, isEnabled, putValue, removePropertyChangeListener, setAction, setEnabled |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final Object KEEP_OPEN
public static final Object AUTO_CLOSE
public static final Object SET_CANCEL
protected GeneralDialog dialog
protected Object finish
| Constructor Detail |
public DialogAction(GeneralDialog dialog,
Action action,
Object finish)
Constructs a DialogAction object using
a GeneralDialog object,
an action that must be performed for that dialog,
and an object that determines what will happen to
the dialog when the action is done.
The finish parameter must be one of the following values:
If the parameter is not one of these values,
the finish is set to DialogAction.AUTO_CLOSE.
A NullPointerException will be thrown if the
GeneralDialog object is null.
dialog - the dialog to act onaction - the action to performfinish - what to do to the dialog when the action is doneDialogAction(GeneralDialog, String, Object),
DialogAction(GeneralDialog, String, Icon, Object),
DialogAction(GeneralDialog, Object[])
public DialogAction(GeneralDialog dialog,
String name,
Object finish)
Constructs a DialogAction object using
a GeneralDialog object,
a name to define a trivial action,
and an object that determines what will happen to
the dialog when the action is done.
The finish parameter must be one of the following values:
If the parameter is not one of these values,
the finish is set to DialogAction.AUTO_CLOSE.
A NullPointerException will be thrown if the
GeneralDialog object is null.
dialog - the dialog to act onname - the name for a trivial actionfinish - what to do to the dialog when the action is doneDialogAction(GeneralDialog, Action, Object),
DialogAction(GeneralDialog, String, Icon, Object),
DialogAction(GeneralDialog, Object[])
public DialogAction(GeneralDialog dialog,
String name,
Icon icon,
Object finish)
Constructs a DialogAction object using
a GeneralDialog object,
a name and icon to define a trivial action,
and an object that determines what will happen to
the dialog when the action is done.
The finish parameter must be one of the following values:
If the parameter is not one of these values,
the finish is set to DialogAction.AUTO_CLOSE.
A NullPointerException will be thrown if the
GeneralDialog object is null.
dialog - the dialog to act onname - the name for a trivial actionicon - the icon for a trivial actionfinish - what to do to the dialog when the action is doneDialogAction(GeneralDialog, Action, Object),
DialogAction(GeneralDialog, String, Object),
DialogAction(GeneralDialog, Object[])
public DialogAction(GeneralDialog dialog,
Object[] actionData)
Constructs a DialogAction object using
a GeneralDialog object and
an action data array to set the action and finish.
The parameter actionData is an Object[]
array that specifies the action and finish in one of the following
ways:
The option parameter must be one of the following values that will determine what is done to the dialog when the action is finished:
The default if the option is not specified is DialogAction.AUTO_CLOSE.
A NullPointerException will be thrown if the
GeneralDialog object is null.
dialog - the dialog to act onactionData - the array used to generate the dialog actionsDialogAction(GeneralDialog, Action, Object),
DialogAction(GeneralDialog, String, Object),
DialogAction(GeneralDialog, String, Icon, Object)| Method Detail |
public void actionPerformed(ActionEvent event)
actionPerformed method of the
encapsulated action and then performs the action
specified as the finish action.
actionPerformed in interface ActionListeneractionPerformed in class ActionWrapperevent - the event that invoked this actionpublic Object getFinish()
setFinish(Object),
setActionAndFinish(Object[])public void setFinish(Object finish)
Sets the choice of what to do to the dialog when the action is done to the given parameter.
The finish parameter must be one of the following values:
If the finish parameter is not one of these values, this method does nothing.
finish - what to do to the dialog when the action is donegetFinish(),
setActionAndFinish(Object[])public void setActionAndFinish(Object[] actionData)
public static DialogAction makeDialogAction(GeneralDialog dialog,
Object[] actionData)
public static DialogAction[] makeDialogActions(GeneralDialog dialog,
Object[][] actionData)
public static Action makeTrivialAction(String name)
name - the name of the trivial actionmakeTrivialAction(String, Icon)
public static Action makeTrivialAction(String name,
Icon icon)
name - the name of the trivial actionicon - the icon of the trivial actionmakeTrivialAction(String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||