|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
edu.neu.ccs.gui.GeneralDialog
A dialog box containing
a
and an Component
that contains actions to respond to and dismiss the dialog.ActionsPanel
As of 2.6.0, improved setBackground and
added setDeepBackground in a manner similar
to DisplayPanel.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JDialog |
JDialog.AccessibleJDialog |
| Nested classes inherited from class java.awt.Dialog |
Dialog.AccessibleAWTDialog |
| Nested classes inherited from class java.awt.Window |
Window.AccessibleAWTWindow |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
protected ActionsPanel |
actionsPanel
The actions panel with the user response buttons. |
protected boolean |
cancelled
Whether or not this dialog was dismissed by cancellation. |
protected Component |
component
The component displayed in this dialog. |
protected TablePanel |
contentPanel
The content panel to combine the component and actions panel. |
protected Dialog |
parentDialog
Parent Dialog if any. |
protected Frame |
parentFrame
Parent Frame if any. |
protected String |
response
User response to this dialog. |
static String |
WINDOW_CLOSED
Response returned by the default dialog window closing action. |
protected WindowActionAdapter |
windowActionAdapter
Window action adapter for this dialog. |
protected DialogAction |
windowClosingAction
Window closing action for this dialog. |
protected Action |
windowOpenedAction
Window opened action for this dialog. |
protected DisplayPanel |
wrapperPanel
The wrapper panel to ensure that the content panel is centered. |
| Fields inherited from class javax.swing.JDialog |
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Dialog |
|
| Fields inherited from class java.awt.Window |
|
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface edu.neu.ccs.console.ConsoleAware |
console |
| Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
GeneralDialog(Object displayObject)
Constructs a modal general dialog containing the Component associated with the given display object,
an empty dialog title,
an empty ActionsPanel,
and no parent window. |
|
GeneralDialog(Object displayObject,
String title)
Constructs a modal general dialog containing the Component associated with the given display object,
the given dialog title,
an empty ActionsPanel,
and no parent window. |
|
GeneralDialog(Object displayObject,
String title,
Object[][] actionData)
Constructs a modal general dialog containing the Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
and no parent window. |
|
GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
boolean modal)
Constructs a general dialog containing the Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the given choice of whether or not the dialog is modal,
and no parent window. |
|
GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
boolean modal,
Dialog parent)
Constructs a general dialog containing the Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the given choice of whether or not the dialog is modal,
and the given parent window. |
|
GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
boolean modal,
Frame parent)
Constructs a general dialog containing the Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the given choice of whether or not the dialog is modal,
and the given parent window. |
|
GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
Object defaultAction)
Constructs a modal general dialog containing the Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the action for the default button,
and no parent window. |
|
GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
Object defaultAction,
boolean modal)
Constructs a general dialog containing the Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the action for the default button,
the given choice of whether or not the dialog is modal,
and no parent window. |
|
GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
Object defaultAction,
boolean modal,
Dialog parent)
Constructs a general dialog containing the Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the action for the default button,
the given choice of whether or not the dialog is modal,
and the given parent window. |
|
GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
Object defaultAction,
boolean modal,
Frame parent)
Constructs a general dialog containing the Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the action for the default button,
the given choice of whether or not the dialog is modal,
and the given parent window. |
|
| Method Summary | |
JButton |
addAction(Action action,
Object finish)
Adds the given ordinary action with the given finish parameter to the actions panel for this dialog and returns the associated button. |
JButton |
addAction(DialogAction action)
Adds the given dialog action to the actions panel for this dialog and returns the associated button. |
JButton |
addAction(String name,
Icon icon,
Object finish)
Adds a trivial action with the given name, icon, and finish parameter to the actions panel for this dialog and returns the associated button. |
JButton |
addAction(String name,
Object finish)
Adds a trivial action with the given name and finish parameter to the actions panel for this dialog and returns the associated button. |
void |
center()
Centers this dialog on the user screen or in its parent window. |
protected void |
closeDialog()
Closes and disposes this dialog. |
protected void |
createContentPane()
Creates the dialog content pane. |
Action[] |
getActions()
Returns the Action objects
in the actions panel for this dialog. |
DialogAction |
getDefaultWindowClosingAction()
Returns the default dialog window closing action. |
DialogAction[] |
getDialogActions()
Returns the DialogAction objects
in the actions panel for this dialog. |
ActionsPanel |
getDialogActionsPanel()
Returns the actions panel for this dialog. |
Component |
getDialogContents()
Returns the main component in this dialog. |
String |
getResponse()
Returns the user's response to this dialog. |
WindowActionAdapter |
getWindowActionAdapter()
Returns the WindowActionAdapter for this dialog. |
DialogAction |
getWindowClosingAction()
Returns the current dialog window closing action. |
Action |
getWindowOpenedAction()
Returns the current dialog window opened action. |
protected void |
initializeGeneralDialog(Object displayObject,
Object[][] actionData,
Object defaultAction)
Performs the common tasks required for constructors of this class using the given display object, action data, and default action. |
protected void |
installWindowActionAdapter()
Installs the default window action adapter for this dialog using the default window closing action. |
protected Component |
makeComponent(Object o)
Returns a Component for the given object
constructed using the
method in . |
static GeneralDialog |
makeOKCancelDialog(Object displayObject,
String title)
Makes a GeneralDialog
with the given display object and title
and "OK" and a "Cancel" buttons with "OK" as the default. |
static GeneralDialog |
makeOKDialog(Object displayObject,
String title)
Makes a GeneralDialog
with the given display object and title
and with an "OK" button that is the default button. |
static GeneralDialog |
makeOneButtonDialog(Object displayObject,
String title,
Action action)
Makes a GeneralDialog
with the given display object and title
and a single action button that is the default button. |
static GeneralDialog |
makeOneButtonDialog(Object displayObject,
String title,
String name)
Makes a GeneralDialog
with the given display object and title
and a single default button with the given name. |
static GeneralDialog |
makeOneButtonDialog(Object displayObject,
String title,
String name,
Icon icon)
Makes a GeneralDialog
with the given display object and title
and a single default button with the given name and icon. |
static GeneralDialog |
makeYesNoCancelDialog(Object displayObject,
String title)
Makes a GeneralDialog
with the given display object and title
and "Yes", "No", and "Cancel" buttons
with "Yes" as the default. |
void |
setBackground(Color c)
Overrides the inherited setBackground to set
not only the background of the dialog itself but also the
background of its top level entities. |
protected void |
setCancelled(boolean cancelled)
Sets whether or not this dialog was cancelled. |
void |
setDeepBackground(Color c)
Sets the background of this object to the given color; then sets the background of each component within this object to the same color using setDeepBackground recursively for each
component that happens to extend DisplayPanel or
JPTComponent. |
void |
setDeepBackground(Color c,
Class type)
Sets the background of all components in the hierarchy of this object that are instances of the given class. |
void |
setDefaultButton(Action action)
Sets the button that corresponds to the given action as the default button for this dialog. |
void |
setDefaultButton(JButton button)
Sets the given button as the default button for this dialog. |
void |
setDefaultButton(String name)
Sets the button that corresponds to the given name as the default button for this dialog. |
protected void |
setResponseAndClose(String userResponse)
Sets the user response String and closes this dialog. |
void |
setVisible(boolean makeVisible)
Overrides the default setVisible behavior
to automatically pack and center when the dialog is shown. |
void |
setWindowClosingAction(Action action,
Object finish)
Sets the dialog window closing action to a dialog action created from the given ordinary action and the given dialog finish parameter. |
void |
setWindowClosingAction(DialogAction action)
Sets the dialog window closing action to the given dialog action. |
void |
setWindowClosingAction(String name,
Object finish)
Sets the dialog window closing action to a dialog action created with the given name and the given dialog finish parameter. |
void |
setWindowOpenedAction(Action action)
Sets the dialog window opened action to the given action. |
static String |
showOKCancelDialog(Object displayObject,
String title)
Shows a GeneralDialog
with the given display object and title
and "OK" and a "Cancel" buttons with "OK" as the default. |
static String |
showOKDialog(Object displayObject,
String title)
Shows a GeneralDialog with the given display object and
title and with an "OK" button that is the default button. |
static String |
showOneButtonDialog(Object displayObject,
String title,
Action action)
Shows a GeneralDialog
with the given display object and title
and a single action button that is the default button. |
static String |
showOneButtonDialog(Object displayObject,
String title,
String name)
Shows a GeneralDialog
with the given display object and title
and a single default button with the given name. |
static String |
showOneButtonDialog(Object displayObject,
String title,
String name,
Icon icon)
Shows a GeneralDialog
with the given display object and title
and a single default button with the given name and icon. |
static String |
showYesNoCancelDialog(Object displayObject,
String title)
Shows a GeneralDialog
with the given display object and title
and "Yes", "No", and "Cancel" buttons
with "Yes" as the default. |
boolean |
wasCancelled()
Returns whether or not this dialog was dismissed by cancellation. |
| Methods inherited from class java.awt.Dialog |
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String WINDOW_CLOSED
protected Component component
protected ActionsPanel actionsPanel
protected TablePanel contentPanel
protected DisplayPanel wrapperPanel
protected DialogAction windowClosingAction
protected Action windowOpenedAction
protected WindowActionAdapter windowActionAdapter
protected Frame parentFrame
Frame if any.
protected Dialog parentDialog
Dialog if any.
protected String response
protected boolean cancelled
| Constructor Detail |
public GeneralDialog(Object displayObject)
Constructs a modal general dialog containing the
Component associated with the given display object,
an empty dialog title,
an empty ActionsPanel,
and no parent window.
Other constructors:
- GeneralDialog(Object, String)
- GeneralDialog(Object, String, Object[][])
- GeneralDialog(Object, String, Object[][], boolean)
- GeneralDialog(Object, String, Object[][], boolean, Frame)
- GeneralDialog(Object, String, Object[][], boolean, Dialog)
- GeneralDialog(Object, String, Object[][], Object)
- GeneralDialog(Object, String, Object[][], Object, boolean)
- GeneralDialog(Object, String, Object[][], Object, boolean, Frame)
- GeneralDialog(Object, String, Object[][], Object, boolean, Dialog)
If the given display object is null
or has no associated Component,
an empty JPanel will be added.
displayObject - the object to display in the dialog
public GeneralDialog(Object displayObject,
String title)
Constructs a modal general dialog containing the
Component associated with the given display object,
the given dialog title,
an empty ActionsPanel,
and no parent window.
If the given display object is null
or has no associated Component,
an empty JPanel will be added.
displayObject - the object to display in the dialogtitle - the title text for the dialogGeneralDialog(Object)
public GeneralDialog(Object displayObject,
String title,
Object[][] actionData)
Constructs a modal general dialog containing the
Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
and no parent window.
If the given display object is null
or has no associated Component,
an empty JPanel will be added.
The parameter actionData
is an Object[][] array that specifies
each dialog Action in one of the following ways:
ActionIf the option parameter is specified, it must be one of the following values that will determine what is done to the dialog when the action is finished:
- DialogAction.KEEP_OPEN
- DialogAction.AUTO_CLOSE
- DialogAction.SET_CANCEL
If the option parameter is not specified, it is taken to be
DialogAction.AUTO_CLOSE.
All actions specified by the parameter actionData
will be encapsulated as DialogAction objects.
displayObject - the object to display in the dialogtitle - the title text for the dialogactionData - the array used to generate the dialog actionsGeneralDialog(Object)
public GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
boolean modal)
Constructs a general dialog containing the
Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the given choice of whether or not the dialog is modal,
and no parent window.
If the given display object is null
or has no associated Component,
an empty JPanel will be added.
The parameter actionData
is an Object[][] array that specifies
each dialog Action in one of the following ways:
ActionIf the option parameter is specified, it must be one of the following values that will determine what is done to the dialog when the action is finished:
- DialogAction.KEEP_OPEN
- DialogAction.AUTO_CLOSE
- DialogAction.SET_CANCEL
If the option parameter is not specified, it is taken to be
DialogAction.AUTO_CLOSE.
All actions specified by the parameter actionData
will be encapsulated as DialogAction objects.
displayObject - the object to display in the dialogtitle - the title text for the dialogactionData - the array used to generate the dialog actionsmodal - the choice of whether or not the dialog is modalGeneralDialog(Object)
public GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
boolean modal,
Frame parent)
Constructs a general dialog containing the
Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the given choice of whether or not the dialog is modal,
and the given parent window.
If the given display object is null
or has no associated Component,
an empty JPanel will be added.
The parameter actionData
is an Object[][] array that specifies
each dialog Action in one of the following ways:
ActionIf the option parameter is specified, it must be one of the following values that will determine what is done to the dialog when the action is finished:
- DialogAction.KEEP_OPEN
- DialogAction.AUTO_CLOSE
- DialogAction.SET_CANCEL
If the option parameter is not specified, it is taken to be
DialogAction.AUTO_CLOSE.
All actions specified by the parameter actionData
will be encapsulated as DialogAction objects.
displayObject - the object to display in the dialogtitle - the title text for the dialogactionData - the array used to generate the dialog actionsmodal - the choice of whether or not the dialog is modalparent - the parent windowGeneralDialog(Object)
public GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
boolean modal,
Dialog parent)
Constructs a general dialog containing the
Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the given choice of whether or not the dialog is modal,
and the given parent window.
If the given display object is null
or has no associated Component,
an empty JPanel will be added.
The parameter actionData
is an Object[][] array that specifies
each dialog Action in one of the following ways:
ActionIf the option parameter is specified, it must be one of the following values that will determine what is done to the dialog when the action is finished:
- DialogAction.KEEP_OPEN
- DialogAction.AUTO_CLOSE
- DialogAction.SET_CANCEL
If the option parameter is not specified, it is taken to be
DialogAction.AUTO_CLOSE.
All actions specified by the parameter actionData
will be encapsulated as DialogAction objects.
displayObject - the object to display in the dialogtitle - the title text for the dialogactionData - the array used to generate the dialog actionsmodal - the choice of whether or not the dialog is modalparent - the parent windowGeneralDialog(Object)
public GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
Object defaultAction)
Constructs a modal general dialog containing the
Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the action for the default button,
and no parent window.
If the given display object is null
or has no associated Component,
an empty JPanel will be added.
The parameter actionData
is an Object[][] array that specifies
each dialog Action in one of the following ways:
ActionIf the option parameter is specified, it must be one of the following values that will determine what is done to the dialog when the action is finished:
- DialogAction.KEEP_OPEN
- DialogAction.AUTO_CLOSE
- DialogAction.SET_CANCEL
If the option parameter is not specified, it is taken to be
DialogAction.AUTO_CLOSE.
All actions specified by the parameter actionData
will be encapsulated as DialogAction objects.
The Object supplied for the default action must either be
an Action or a name that is supplied in the action data. If
the parameter is null, no default action is set.
displayObject - the object to display in the dialogtitle - the title text for the dialogactionData - the array used to generate the dialog actionsdefaultAction - the default actionGeneralDialog(Object)
public GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
Object defaultAction,
boolean modal)
Constructs a general dialog containing the
Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the action for the default button,
the given choice of whether or not the dialog is modal,
and no parent window.
If the given display object is null
or has no associated Component,
an empty JPanel will be added.
The parameter actionData
is an Object[][] array that specifies
each dialog Action in one of the following ways:
ActionIf the option parameter is specified, it must be one of the following values that will determine what is done to the dialog when the action is finished:
- DialogAction.KEEP_OPEN
- DialogAction.AUTO_CLOSE
- DialogAction.SET_CANCEL
If the option parameter is not specified, it is taken to be
DialogAction.AUTO_CLOSE.
All actions specified by the parameter actionData
will be encapsulated as DialogAction objects.
The Object supplied for the default action must either be
an Action or a name that is supplied in the action data. If
the parameter is null, no default action is set.
displayObject - the object to display in the dialogtitle - the title text for the dialogactionData - the array used to generate the dialog actionsdefaultAction - the default actionmodal - the choice of whether or not the dialog is modalGeneralDialog(Object)
public GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
Object defaultAction,
boolean modal,
Frame parent)
Constructs a general dialog containing the
Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the action for the default button,
the given choice of whether or not the dialog is modal,
and the given parent window.
If the given display object is null
or has no associated Component,
an empty JPanel will be added.
The parameter actionData
is an Object[][] array that specifies
each dialog Action in one of the following ways:
ActionIf the option parameter is specified, it must be one of the following values that will determine what is done to the dialog when the action is finished:
- DialogAction.KEEP_OPEN
- DialogAction.AUTO_CLOSE
- DialogAction.SET_CANCEL
If the option parameter is not specified, it is taken to be
DialogAction.AUTO_CLOSE.
All actions specified by the parameter actionData
will be encapsulated as DialogAction objects.
The Object supplied for the default action must either be
an Action or a name that is supplied in the action data. If
the parameter is null, no default action is set.
displayObject - the object to display in the dialogtitle - the title text for the dialogactionData - the array used to generate the dialog actionsdefaultAction - the default actionmodal - the choice of whether or not the dialog is modalparent - the parent windowGeneralDialog(Object)
public GeneralDialog(Object displayObject,
String title,
Object[][] actionData,
Object defaultAction,
boolean modal,
Dialog parent)
Constructs a general dialog containing the
Component associated with the given display object,
the given dialog title,
an ActionsPanel constructed from the given action data,
the action for the default button,
the given choice of whether or not the dialog is modal,
and the given parent window.
If the given display object is null
or has no associated Component,
an empty JPanel will be added.
The parameter actionData
is an Object[][] array that specifies
each dialog Action in one of the following ways:
ActionIf the option parameter is specified, it must be one of the following values that will determine what is done to the dialog when the action is finished:
- DialogAction.KEEP_OPEN
- DialogAction.AUTO_CLOSE
- DialogAction.SET_CANCEL
If the option parameter is not specified, it is taken to be
DialogAction.AUTO_CLOSE.
All actions specified by the parameter actionData
will be encapsulated as DialogAction objects.
The Object supplied for the default action must either be
an Action or a name that is supplied in the action data. If
the parameter is null, no default action is set.
displayObject - the object to display in the dialogtitle - the title text for the dialogactionData - the array used to generate the dialog actionsdefaultAction - the default actionmodal - the choice of whether or not the dialog is modalparent - the parent windowGeneralDialog(Object)| Method Detail |
public void setVisible(boolean makeVisible)
setVisible behavior
to automatically pack and center when the dialog is shown.
makeVisible - whether or not to make the dialog visiblecenter()public void center()
setVisible(boolean)public void setBackground(Color c)
Overrides the inherited setBackground to set
not only the background of the dialog itself but also the
background of its top level entities.
This method is not recursive.
public void setDeepBackground(Color c)
setDeepBackground recursively for each
component that happens to extend DisplayPanel or
JPTComponent.
c - the background color
public void setDeepBackground(Color c,
Class type)
Sets the background of all components in the hierarchy of this object that are instances of the given class.
The background of the object itself will be set only if it is an instance of the given class.
The hierarchy is determined recursively as entities in
instances of either DisplayPanel or
JPTComponent.
c - the background colortype - the class whose objects should changepublic Component getDialogContents()
getDialogActionsPanel()public ActionsPanel getDialogActionsPanel()
getDialogContents()public Action[] getActions()
Action objects
in the actions panel for this dialog.
getDialogActions()public DialogAction[] getDialogActions()
Returns the DialogAction objects
in the actions panel for this dialog.
Uses the same indexing as in the
method
and returns getActionsnull for those Action objects
that are not DialogAction objects.
getActions()public JButton addAction(DialogAction action)
action - the dialog action to add to the actions paneladdAction(Action, Object),
addAction(String, Object),
addAction(String, Icon, Object)
public JButton addAction(Action action,
Object finish)
Adds the given ordinary action with the given finish parameter to the actions panel for this dialog and returns the associated button.
The finish parameter must be one of the following values:
The default if the finish parameter is null,
or is not one of these values,
is DialogAction.AUTO_CLOSE.
action - the ordinary action to add to the actions panelfinish - what to do to the dialog when the action is doneaddAction(DialogAction),
addAction(String, Object),
addAction(String, Icon, Object)
public JButton addAction(String name,
Object finish)
Adds a trivial action with the given name and finish parameter to the actions panel for this dialog and returns the associated button.
The finish parameter must be one of the following values:
The default if the finish parameter is null,
or is not one of these values,
is DialogAction.AUTO_CLOSE.
name - the name for a trivial actionfinish - what to do to the dialog when the action is doneaddAction(DialogAction),
addAction(Action, Object),
addAction(String, Icon, Object)
public JButton addAction(String name,
Icon icon,
Object finish)
Adds a trivial action with the given name, icon, and finish parameter to the actions panel for this dialog and returns the associated button.
The finish parameter must be one of the following values:
The default if the finish parameter is null,
or is not one of these values,
is DialogAction.AUTO_CLOSE.
name - the name for a trivial actionicon - the icon for a trivial actionfinish - what to do to the dialog when the action is doneaddAction(DialogAction),
addAction(Action, Object),
addAction(String, Object)public void setDefaultButton(JButton button)
button - the button to set as the default buttonsetDefaultButton(Action),
setDefaultButton(String),
ActionsPanel.setDefaultButton(JButton)public void setDefaultButton(Action action)
action - the action whose button should be the default buttonsetDefaultButton(JButton),
setDefaultButton(String),
ActionsPanel.setDefaultButton(Action)public void setDefaultButton(String name)
name - the name whose button should be the default buttonsetDefaultButton(JButton),
setDefaultButton(Action),
ActionsPanel.setDefaultButton(String)public Action getWindowOpenedAction()
setWindowOpenedAction(Action)public void setWindowOpenedAction(Action action)
action - the action to perform when the user opens the dialoggetWindowOpenedAction()public DialogAction getWindowClosingAction()
getDefaultWindowClosingAction(),
setWindowClosingAction(DialogAction),
setWindowClosingAction(Action, Object),
setWindowClosingAction(String, Object)public DialogAction getDefaultWindowClosingAction()
String WINDOW_CLOSED.
getWindowClosingAction(),
setWindowClosingAction(DialogAction),
setWindowClosingAction(Action, Object),
setWindowClosingAction(String, Object)public void setWindowClosingAction(DialogAction action)
action is null
then the default window closing action will be installed.
action - the action to perform if the user closes the dialoggetWindowClosingAction(),
getDefaultWindowClosingAction(),
setWindowClosingAction(Action, Object),
setWindowClosingAction(String, Object)
public void setWindowClosingAction(Action action,
Object finish)
Sets the dialog window closing action to a dialog action created from the given ordinary action and the given dialog finish parameter.
The finish parameter must be one of the following values:
The default if the finish parameter is null,
or is not one of these values,
is DialogAction.AUTO_CLOSE.
action - the action to perform if the user closes the dialogfinish - what to do to the dialog when the action is donegetWindowClosingAction(),
getDefaultWindowClosingAction(),
setWindowClosingAction(DialogAction),
setWindowClosingAction(String, Object)
public void setWindowClosingAction(String name,
Object finish)
Sets the dialog window closing action to a dialog action created with the given name and the given dialog finish parameter. The created action will do work.
The finish parameter must be one of the following values:
The default if the finish parameter is null,
or is not one of these values,
is DialogAction.AUTO_CLOSE.
name - the name for a trivial actionfinish - what to do to the dialog when the action is donegetWindowClosingAction(),
getDefaultWindowClosingAction(),
setWindowClosingAction(DialogAction),
setWindowClosingAction(Action, Object)public WindowActionAdapter getWindowActionAdapter()
WindowActionAdapter for this dialog.
public String getResponse()
setResponseAndClose(String),
closeDialog()public boolean wasCancelled()
false.
public static GeneralDialog makeOneButtonDialog(Object displayObject,
String title,
Action action)
GeneralDialog
with the given display object and title
and a single action button that is the default button.
Closing the dialog window is equivalent to clicking the button.
displayObject - the object to display in the dialogtitle - the title text for the dialogaction - the action to install as a buttonmakeOneButtonDialog(Object, String, Action),
showOneButtonDialog(Object, String, Action),
makeOneButtonDialog(Object, String, String),
showOneButtonDialog(Object, String, String),
makeOneButtonDialog(Object, String, String, Icon),
showOneButtonDialog(Object, String, String, Icon),
makeOKDialog(Object, String),
showOKDialog(Object, String)
public static String showOneButtonDialog(Object displayObject,
String title,
Action action)
GeneralDialog
with the given display object and title
and a single action button that is the default button.
Closing the dialog window is equivalent to clicking the button.
displayObject - the object to display in the dialogtitle - the title text for the dialogaction - the action to install as a buttonGeneralDialog(Object, String, Object[][]),
makeOneButtonDialog(Object, String, Action),
makeOneButtonDialog(Object, String, String),
showOneButtonDialog(Object, String, String),
makeOneButtonDialog(Object, String, String, Icon),
showOneButtonDialog(Object, String, String, Icon),
makeOKDialog(Object, String),
showOKDialog(Object, String)
public static GeneralDialog makeOneButtonDialog(Object displayObject,
String title,
String name)
GeneralDialog
with the given display object and title
and a single default button with the given name.
Closing the dialog window is equivalent to clicking the button.
displayObject - the object to display in the dialogtitle - the title text for the dialogname - the name to install on the buttonGeneralDialog(Object, String, Object[][]),
makeOneButtonDialog(Object, String, Action),
showOneButtonDialog(Object, String, Action),
showOneButtonDialog(Object, String, String),
makeOneButtonDialog(Object, String, String, Icon),
showOneButtonDialog(Object, String, String, Icon),
makeOKDialog(Object, String),
showOKDialog(Object, String)
public static String showOneButtonDialog(Object displayObject,
String title,
String name)
GeneralDialog
with the given display object and title
and a single default button with the given name.
Closing the dialog window is equivalent to clicking the button.
displayObject - the object to display in the dialogtitle - the title text for the dialogname - the name to install on the buttonGeneralDialog(Object, String, Object[][]),
makeOneButtonDialog(Object, String, Action),
showOneButtonDialog(Object, String, Action),
makeOneButtonDialog(Object, String, String),
makeOneButtonDialog(Object, String, String, Icon),
showOneButtonDialog(Object, String, String, Icon),
makeOKDialog(Object, String),
showOKDialog(Object, String)
public static GeneralDialog makeOneButtonDialog(Object displayObject,
String title,
String name,
Icon icon)
GeneralDialog
with the given display object and title
and a single default button with the given name and icon.
Closing the dialog window is equivalent to clicking the button.
displayObject - the object to display in the dialogtitle - the title text for the dialogname - the name to install on the buttonicon - the icon to install on the buttonGeneralDialog(Object, String, Object[][]),
makeOneButtonDialog(Object, String, Action),
showOneButtonDialog(Object, String, Action),
makeOneButtonDialog(Object, String, String),
showOneButtonDialog(Object, String, String),
showOneButtonDialog(Object, String, String, Icon),
makeOKDialog(Object, String),
showOKDialog(Object, String)
public static String showOneButtonDialog(Object displayObject,
String title,
String name,
Icon icon)
GeneralDialog
with the given display object and title
and a single default button with the given name and icon.
Closing the dialog window is equivalent to clicking the button.
displayObject - the object to display in the dialogtitle - the title text for the dialogname - the name to install on the buttonicon - the icon to install on the buttonGeneralDialog(Object, String, Object[][]),
makeOneButtonDialog(Object, String, Action),
showOneButtonDialog(Object, String, Action),
makeOneButtonDialog(Object, String, String),
showOneButtonDialog(Object, String, String),
makeOneButtonDialog(Object, String, String, Icon),
makeOKDialog(Object, String),
showOKDialog(Object, String)
public static GeneralDialog makeOKDialog(Object displayObject,
String title)
GeneralDialog
with the given display object and title
and with an "OK" button that is the default button.
Closing the dialog window is equivalent to clicking "OK".
displayObject - the object to display in the dialogtitle - the title text for the dialogGeneralDialog(Object, String, Object[][]),
makeOneButtonDialog(Object, String, Action),
showOneButtonDialog(Object, String, Action),
makeOneButtonDialog(Object, String, String),
showOneButtonDialog(Object, String, String),
makeOneButtonDialog(Object, String, String, Icon),
showOneButtonDialog(Object, String, String, Icon),
showOKDialog(Object, String)
public static String showOKDialog(Object displayObject,
String title)
GeneralDialog with the given display object and
title and with an "OK" button that is the default button.
Closing the dialog window is equivalent to clicking "OK".
displayObject - the object to display in the dialogtitle - the title text for the dialogGeneralDialog(Object, String, Object[][]),
makeOneButtonDialog(Object, String, Action),
showOneButtonDialog(Object, String, Action),
makeOneButtonDialog(Object, String, String),
showOneButtonDialog(Object, String, String),
makeOneButtonDialog(Object, String, String, Icon),
showOneButtonDialog(Object, String, String, Icon),
makeOKDialog(Object, String)
public static GeneralDialog makeOKCancelDialog(Object displayObject,
String title)
GeneralDialog
with the given display object and title
and "OK" and a "Cancel" buttons with "OK" as the default.
Clicking "Cancel" will set the cancelled state of the dialog to true.
Closing the dialog window is equivalent to clicking "Cancel".
displayObject - the object to display in the dialogtitle - the title text for the dialogGeneralDialog(Object, String, Object[][]),
showOKCancelDialog(Object, String)
public static String showOKCancelDialog(Object displayObject,
String title)
throws CancelledException
GeneralDialog
with the given display object and title
and "OK" and a "Cancel" buttons with "OK" as the default.
Clicking "Cancel" will throw a CancelledException.
Closing the dialog window is equivalent to clicking "Cancel".
displayObject - the object to display in the dialogtitle - the title text for the dialog
CancelledExceptionGeneralDialog(Object, String, Object[][]),
makeOKCancelDialog(Object, String)
public static GeneralDialog makeYesNoCancelDialog(Object displayObject,
String title)
GeneralDialog
with the given display object and title
and "Yes", "No", and "Cancel" buttons
with "Yes" as the default.
Clicking "Cancel" will set the cancelled state of the dialog to true.
Closing the dialog window is equivalent to clicking "Cancel".
displayObject - the object to display in the dialogtitle - the title text for the dialogGeneralDialog(Object, String, Object[][]),
showYesNoCancelDialog(Object, String)
public static String showYesNoCancelDialog(Object displayObject,
String title)
throws CancelledException
GeneralDialog
with the given display object and title
and "Yes", "No", and "Cancel" buttons
with "Yes" as the default.
Clicking "Cancel" will throw a CancelledException.
Closing the dialog window is equivalent to clicking "Cancel".
displayObject - the object to display in the dialogtitle - the title text for the dialog
CancelledExceptionGeneralDialog(Object, String, Object[][]),
makeYesNoCancelDialog(Object, String)
protected void initializeGeneralDialog(Object displayObject,
Object[][] actionData,
Object defaultAction)
Performs the common tasks required for constructors of this class using the given display object, action data, and default action.
The given displayObject parameter
will be converted to a Component
using the method.makeComponent
If the given display object is null
or has no associated Component,
an empty JPanel will be added.
The parameter actionData
is an Object[][] array that specifies
each Action 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.
All actions specified by the parameter actionData
will be encapsulated as DialogAction objects.
The Object supplied for the default action must either be
an Action or a name that is supplied in the action data. If
the parameter is null, no default action is set.
displayObject - the object to display in the dialogactionData - the array used to generate the dialog actionsdefaultAction - the default actionprotected Component makeComponent(Object o)
Component for the given object
constructed using the
makeComponent
method in ComponentFactory.
protected void createContentPane()
protected void installWindowActionAdapter()
getWindowClosingAction(),
setWindowClosingAction(DialogAction),
getDefaultWindowClosingAction()protected void setResponseAndClose(String userResponse)
String and closes this dialog.
If the parameter userResponse is null
then an empty String will be set as the user response.
userResponse - a String
representing the user's choicegetResponse(),
closeDialog()protected void closeDialog()
protected void setCancelled(boolean cancelled)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||