|
|||||||||||
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.YesNoDialog
Class YesNoDialog
is used to display a message to
which the user can respond with one of two reponses (i.e. "YES" or
"NO". For example, this dialog is useful for prompting a user:
Eg.
if( hasUnsavedChanges() ) { YesNoDialog confirm_save = new YesNoDialog( my_frame, true, "Save Changes?" ); confirm_save.show(); if( confirm_save.getAction() == YesNoDialog.YES ) { saveChanges(); } }
Nested Class Summary | |
(package private) class |
YesNoDialog.SymAction
|
(package private) class |
YesNoDialog.SymKey
|
(package private) class |
YesNoDialog.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
|
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 |
NO
Defined constant which indicates a negative response by the user to the displayed message |
static String |
NO_COMMAND
Defined constant which indicates a negative response by the user to the displayed message |
(package private) Button |
noButton
|
private static ResourceBundle |
resources
|
private static String |
RESOURCES
|
private static String |
versionID
|
static int |
YES
Defined constant which indicates a positive response by the user to the displayed message |
static String |
YES_COMMAND
Defined constant which indicates a positive response by the user to the displayed message |
(package private) Button |
yesButton
|
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 | |
YesNoDialog(Component component,
boolean modal)
|
|
YesNoDialog(Component component,
boolean modal,
String message)
|
|
YesNoDialog(Component component,
String title,
boolean modal)
|
|
YesNoDialog(Component component,
String title,
boolean modal,
String message)
|
|
YesNoDialog(Frame parent,
boolean modal)
Constructor for YesNoDialog . |
|
YesNoDialog(Frame parent,
boolean modal,
String message)
Constructor for class YesNoDialog |
|
YesNoDialog(Frame parent,
String title,
boolean modal)
Constructor for class YesNoDialog |
|
YesNoDialog(Frame parent,
String title,
boolean modal,
String message)
Constructor for class YesNoDialog |
Method Summary | |
void |
addActionListener(ActionListener l)
Method addActionListener adds listeners to receive
notification of ActionEvents on this dialog. |
void |
addNotify()
|
(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. |
(package private) void |
noButton_Action(ActionEvent event)
|
(package private) void |
noButton_KeyPress(KeyEvent event)
|
private void |
notifyActionListeners(ActionEvent evt)
|
private void |
processNoAction()
|
private void |
processYesAction()
|
void |
removeActionListener(ActionListener l)
Method removeActionListener removes the given
listener from receiving notification of ActionEvents
on this dialog. |
private void |
setContext(boolean context_on)
|
protected void |
setDisplayLocation()
|
void |
setNoButtonLabel(String label)
Method to set the label of the button on this dialog which represents the NO action. |
void |
setYesButtonLabel(String label)
Method to set the label of the button on this dialog which represents the YES action. |
void |
show()
|
(package private) void |
yesButton_Action(ActionEvent event)
|
(package private) void |
yesButton_KeyPress(KeyEvent event)
|
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
Button yesButton
Button noButton
symantec.itools.awt.shape.HorizontalLine horizontalLine1
public static int YES
public static int NO
public static String YES_COMMAND
public static String NO_COMMAND
private static String RESOURCES
private static ResourceBundle resources
private Vector listeners
private int action
private ThreadGroup contextGroup
Constructor Detail |
public YesNoDialog(Frame parent, boolean modal)
YesNoDialog
.
parent
- the owner of this Dialog
modal
- if true
, dialog blocks input to
the parent window when shownDialog
public YesNoDialog(Frame parent, String title, boolean modal)
YesNoDialog
parent
- the owner of this dialogtitle
- the title of this dialogmodal
- if true
, dialog blocks input to
the parent window when shownpublic YesNoDialog(Frame parent, String title, boolean modal, String message)
YesNoDialog
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 YesNoDialog(Frame parent, boolean modal, String message)
YesNoDialog
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 YesNoDialog(Component component, boolean modal)
public YesNoDialog(Component component, String title, boolean modal)
public YesNoDialog(Component component, boolean modal, String message)
public YesNoDialog(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 yesButton_Action(ActionEvent event)
private void processYesAction()
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 Yes or No 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 noButton_Action(ActionEvent event)
private void processNoAction()
public void setYesButtonLabel(String label)
label
- the String
label to be displayed on the
buttonsetNoButtonLabel(java.lang.String)
public void setNoButtonLabel(String label)
label
- the String
label to be displayed on the
buttonsetYesButtonLabel(java.lang.String)
void yesButton_KeyPress(KeyEvent event)
void noButton_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 |