|
||||||||||
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
com.jeta.open.gui.framework.JETADialog
public class JETADialog
This is a base class for all dialogs in the system. It provides a skeleton
dialog box with a cancel and ok button. Callers can add their own containers
to this dialog's content panel. This class also supports validators for the
dialog. This allows the dialog to validate the input and if validation fails,
maintain the dialog on the screen. See JETARule
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JDialog |
---|
JDialog.AccessibleJDialog |
Nested classes/interfaces inherited from class java.awt.Dialog |
---|
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType |
Nested classes/interfaces inherited from class java.awt.Window |
---|
Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
ID_BUTTON_PANEL
The name of the button panel. |
static String |
ID_CANCEL
|
static String |
ID_OK
The names of the ok and cancel buttons. |
Fields inherited from class javax.swing.JDialog |
---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Dialog |
---|
DEFAULT_MODALITY_TYPE |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
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 | |
---|---|
JETADialog(Dialog owner,
boolean bModal)
ctor |
|
JETADialog(Frame owner,
boolean bModal)
ctor |
Method Summary | |
---|---|
protected void |
_initialize()
Initializes the components on this dialog |
boolean |
actionPerformed(String commandId,
ActionEvent evt)
Forwarded from the view when an action occurs. |
void |
addController(JETAController controller)
Adds a controller to the list of controllers that can handle events for this dialog. |
void |
addDialogListener(JETADialogListener listener)
Adds a listener to the list of listeners for this dialog |
void |
addValidator(JETARule validator)
This adds a rule that will be used to validate the user input for this dialog. |
void |
addValidator(Object parameter,
JETARule validator)
This adds a rule that will be used to validate the user input for this dialog. |
void |
cmdCancel()
Closes the dialog |
void |
cmdOk()
Close the dialog and set the ok flag |
void |
dispose()
Dispose the dialog |
JPanel |
getButtonPanel()
|
JButton |
getCloseButton()
|
JETAController |
getController()
|
Container |
getDialogContentPanel()
|
JButton |
getHelpButton()
|
JButton |
getOkButton()
|
Dimension |
getPreferredSize()
Returns the preferred size for this dialog. |
protected Dimension |
getPreferredSize(Dimension contentDims)
Returns the preferred size for this dialog. |
Component |
getPrimaryPanel()
|
boolean |
isOk()
|
void |
removeAllControllers()
Removes all registered controllers added to this dialog |
void |
setButtonPanelVisible(boolean bvis)
Shows/Hides the button panel on this dialog. |
void |
setCancelEnabled(boolean bCancel)
Enables/Disables the cancel command |
void |
setCloseText(String txt)
Sets the text for the close button |
void |
setController(JETAController controller)
Sets the controller that will handle events for this dialog |
void |
setFont(Font f)
Sets the font for the ok and close buttons on this dialog |
void |
setInitialFocusComponent(JComponent comp)
Sets the component in this frame that will have initial focus. |
protected void |
setOk(boolean bok)
Sets the Ok flag |
void |
setOkText(String txt)
Sets the text for the ok button |
void |
setPrimaryPanel(JComponent primaryPanel)
Sets the one and only panel for this dialog |
void |
setTitle(String title)
Sets the title to the frame |
void |
showCenter()
Shows the dialog in the center of the screen |
void |
showOkButton(boolean bvis)
Shows/hides the ok button |
void |
updateComponents(EventObject evt)
Updates the components in the dialog based on the model state. |
protected boolean |
validateListeners()
Iterates through the list of listeners and allows them to process the inputs. |
protected boolean |
validateValidators()
Iterates through the list of controller validators and allows them to validate the input for this dialog. |
Methods inherited from class java.awt.Dialog |
---|
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setUndecorated, setVisible, show, toBack |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ID_BUTTON_PANEL
public static final String ID_OK
public static final String ID_CANCEL
Constructor Detail |
---|
public JETADialog(Dialog owner, boolean bModal)
public JETADialog(Frame owner, boolean bModal)
Method Detail |
---|
public boolean actionPerformed(String commandId, ActionEvent evt)
commandId
- the name of the action associated with the eventevt
- the action event
public void addController(JETAController controller)
controller
- the controller to addpublic void addDialogListener(JETADialogListener listener)
public void addValidator(JETARule validator)
public void addValidator(Object parameter, JETARule validator)
parameter
- a parameter to pass to the validator. If this object is an
Object[] type, then it is passed directly to the validator.validator
- the rule to add to this dialog.public void cmdCancel()
public void cmdOk()
public void dispose()
dispose
in class Window
public JPanel getButtonPanel()
public JButton getCloseButton()
public JETAController getController()
public Container getDialogContentPanel()
public JButton getHelpButton()
public JButton getOkButton()
public Dimension getPreferredSize()
getPreferredSize
in class Container
protected Dimension getPreferredSize(Dimension contentDims)
public Component getPrimaryPanel()
protected void _initialize()
public boolean isOk()
public void removeAllControllers()
public void setButtonPanelVisible(boolean bvis)
public void setCancelEnabled(boolean bCancel)
public void setCloseText(String txt)
public void setFont(Font f)
setFont
in class Container
f
- the new font to setpublic void setPrimaryPanel(JComponent primaryPanel)
public void setController(JETAController controller)
public void setInitialFocusComponent(JComponent comp)
comp
- the component that gets initial focus when dialog is displayedprotected void setOk(boolean bok)
public void setOkText(String txt)
public void setTitle(String title)
setTitle
in class Dialog
public void showCenter()
public void showOkButton(boolean bvis)
public void updateComponents(EventObject evt)
protected boolean validateListeners()
protected boolean validateValidators()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |