|
|||||||||||
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
wt.clients.gui.OkCancelDialog
Class OkCancelDialog
is used to display a message to
which the user can respond with one of two reponses (i.e. "OK" or
"Cancel". For example, this dialog is useful for prompting a user:
Eg.
if( hasUnsavedChanges() ) { OkCancelDialog confirm_save = new OkCancelDialog( my_frame, true, "Save Changes?" ); confirm_save.show(); if( confirm_save.getAction() == OkCancelDialog.OK ) { saveChanges(); } }
Nested Class Summary | |
(package private) class |
OkCancelDialog.SymAction
|
(package private) class |
OkCancelDialog.SymKey
|
(package private) class |
OkCancelDialog.SymWindow
|
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 | |
private int |
action
|
(package private) Panel |
buttonPanel
|
static int |
CANCEL
Defined constant which indicates a negative response by the user to the displayed message |
static String |
CANCEL_COMMAND
Defined constant which indicates a negative response by the user to the displayed message |
(package private) symantec.itools.awt.LabelButton |
cancelButton
|
private ThreadGroup |
contextGroup
|
(package private) boolean |
fComponentsAdjusted
|
(package private) symantec.itools.awt.shape.HorizontalLine |
horizontalLine1
|
private Vector |
listeners
|
(package private) symantec.itools.awt.WrappingLabel |
messageLabel
|
static int |
OK
Defined constant which indicates a positive response by the user to the displayed message |
static String |
OK_COMMAND
Defined constant which indicates a positive response by the user to the displayed message |
(package private) symantec.itools.awt.LabelButton |
okButton
|
private static ResourceBundle |
resources
|
private static String |
RESOURCES
|
private static String |
versionID
|
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 java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
OkCancelDialog(Component component,
boolean modal)
|
|
OkCancelDialog(Component component,
boolean modal,
String message)
|
|
OkCancelDialog(Component component,
String title,
boolean modal)
|
|
OkCancelDialog(Component component,
String title,
boolean modal,
String message)
|
|
OkCancelDialog(Frame parent,
boolean modal)
Constructor for OkCancelDialog . |
|
OkCancelDialog(Frame parent,
boolean modal,
String message)
Constructor for class OkCancelDialog |
|
OkCancelDialog(Frame parent,
String title,
boolean modal)
Constructor for class OkCancelDialog |
|
OkCancelDialog(Frame parent,
String title,
boolean modal,
String message)
Constructor for class OkCancelDialog |
Method Summary | |
void |
addActionListener(ActionListener l)
Method addActionListener adds listeners to receive
notification of ActionEvents on this dialog. |
void |
addNotify()
|
(package private) void |
cancelButton_Action(ActionEvent event)
|
(package private) void |
cancelButton_KeyPress(KeyEvent event)
|
(package private) void |
Dialog1_WindowClosing(WindowEvent event)
|
int |
getAction()
Method getAction returns the action invoked by the
user on this dialog. |
private static Frame |
getComponentFrame(Component component)
|
private WTContext |
getContext()
|
private static Frame |
getFrame(Component component)
Traverse the parent hierarchy of the given Component until a frame is found. |
private void |
initResources()
Method initResource initializes the ResourceBundle
used for localizing the dialog labels and text. |
private void |
localize()
Method to translate the field labels and button labels of the dialog according to the Locale of the client. |
private void |
notifyActionListeners(ActionEvent evt)
|
(package private) void |
okButton_Action(ActionEvent event)
|
(package private) void |
okButton_KeyPress(KeyEvent event)
|
private void |
processCancelAction()
|
private void |
processOkAction()
|
void |
removeActionListener(ActionListener l)
Method removeActionListener removes the given
listener from receiving notification of ActionEvents
on this dialog. |
void |
setCancelButtonLabel(String label)
Method to set the label of the button on this dialog which represents the Cancel action. |
private void |
setContext(boolean context_on)
|
protected void |
setDisplayLocation()
|
void |
setOkButtonLabel(String label)
Method to set the label of the button on this dialog which represents the OK action. |
void |
show()
|
Methods inherited from class java.awt.Dialog |
dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setResizable, setTitle, setUndecorated |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String versionID
boolean fComponentsAdjusted
symantec.itools.awt.WrappingLabel messageLabel
Panel buttonPanel
symantec.itools.awt.LabelButton okButton
symantec.itools.awt.LabelButton cancelButton
symantec.itools.awt.shape.HorizontalLine horizontalLine1
public static int OK
public static int CANCEL
public static String OK_COMMAND
public static String CANCEL_COMMAND
private static String RESOURCES
private static ResourceBundle resources
private Vector listeners
private int action
private ThreadGroup contextGroup
Constructor Detail |
public OkCancelDialog(Frame parent, boolean modal)
OkCancelDialog
.
parent
- the owner of this Dialog
modal
- if true
, dialog blocks input to
the parent window when shownDialog
public OkCancelDialog(Frame parent, String title, boolean modal)
OkCancelDialog
parent
- the owner of this dialogtitle
- the title of this dialogmodal
- if true
, dialog blocks input to
the parent window when shownpublic OkCancelDialog(Frame parent, String title, boolean modal, String message)
OkCancelDialog
parent
- the owner of this dialogtitle
- the title of this dialogmodal
- if true
, dialog blocks input to
the parent window when shownmessage
- the message to be displayed by this dialogpublic OkCancelDialog(Frame parent, boolean modal, String message)
OkCancelDialog
parent
- the owner of this dialogmodal
- if true
, dialog blocks input to
the parent window when shownmessage
- the message to be displayed by this dialogpublic OkCancelDialog(Component component, boolean modal)
public OkCancelDialog(Component component, String title, boolean modal)
public OkCancelDialog(Component component, boolean modal, String message)
public OkCancelDialog(Component component, String title, boolean modal, String message)
Method Detail |
private void initResources()
initResource
initializes the ResourceBundle
used for localizing the dialog labels and text.
ResourceBundle
private void localize()
Locale
of the client.
initResources()
public void addNotify()
public void show()
protected void setDisplayLocation()
void Dialog1_WindowClosing(WindowEvent event)
void okButton_Action(ActionEvent event)
private void processOkAction()
public void addActionListener(ActionListener l)
addActionListener
adds listeners to receive
notification of ActionEvents
on this dialog.
ActionEvents
are generated on this dialog when the
user invokes the OK or Cancel buttons.
l
- the ActionListener
to be notified of
ActionEvents
on this dialogActionListener
,
removeActionListener(java.awt.event.ActionListener)
public void removeActionListener(ActionListener l)
removeActionListener
removes the given
listener from receiving notification of ActionEvents
on this dialog. If the given listener is not found as a current
listener, no changes are made.
l
- the ActionListener
to be removed from
being notified of ActionEvents
on this
dialogActionListener
,
addActionListener(java.awt.event.ActionListener)
public int getAction()
getAction
returns the action invoked by the
user on this dialog.
private void notifyActionListeners(ActionEvent evt)
void cancelButton_Action(ActionEvent event)
private void processCancelAction()
public void setOkButtonLabel(String label)
label
- the String
label to be displayed on the
buttonsetCancelButtonLabel(java.lang.String)
public void setCancelButtonLabel(String label)
label
- the String
label to be displayed on the
buttonsetOkButtonLabel(java.lang.String)
void okButton_KeyPress(KeyEvent event)
void cancelButton_KeyPress(KeyEvent event)
private WTContext getContext()
private void setContext(boolean context_on)
private static Frame getFrame(Component component)
component
- the Component for which an associated
Frame is to be returned
private static Frame getComponentFrame(Component component)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |