wt.clients.gui
Class OkCancelPreferenceDialog

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
                  extended bywt.clients.gui.OkCancelPreferenceDialog
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class OkCancelPreferenceDialog
extends Dialog

See Also:
Serialized Form

Nested Class Summary
(package private)  class OkCancelPreferenceDialog.SymAction
           
(package private)  class OkCancelPreferenceDialog.SymKey
           
(package private)  class OkCancelPreferenceDialog.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
           
static String CANCEL_COMMAND
          Defined constant which indicates a negative response by the user to the displayed message
(package private)  Button cancelButton
           
(package private)  Panel checkboxPanel
           
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
           
(package private)  Panel messagePanel
           
static int OK
           
static String OK_COMMAND
          Defined constant which indicates a positive response by the user to the displayed message
(package private)  Button okButton
           
private  String preference
           
(package private)  Checkbox promptCheckbox
           
protected static String RESOURCES
           
private  boolean useOppositeState
           
private  boolean usePreferenceForDefault
           
 
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
OkCancelPreferenceDialog(Frame parent)
           
OkCancelPreferenceDialog(Frame parent, boolean modal)
           
OkCancelPreferenceDialog(Frame parent, boolean modal, String preference)
           
OkCancelPreferenceDialog(Frame parent, String title, boolean modal)
           
 
Method Summary
 void addActionListener(ActionListener l)
          Method addActionListener adds listeners to receive notification of ActionEvents on this dialog.
 void addNotify()
           
(package private)  void cancelButton_ActionPerformed(ActionEvent event)
           
(package private)  void cancelButton_KeyPressed(KeyEvent event)
           
 int getAction()
          Method getAction returns the action invoked by the user on this dialog.
private  WTContext getContext()
           
 boolean getPreference()
           
 String getPreferenceName()
          Returns the String name of the preference used by this dialog when prompting the user.
private  void initializeCheckboxState()
          Initializes the state of the checkbox with the value of the user preference.
 boolean isShowPrompt()
           
protected  void localize()
          Localize the button labels
private  void notifyActionListeners(ActionEvent evt)
           
(package private)  void okButton_ActionPerformed(ActionEvent event)
           
(package private)  void okButton_KeyPressed(KeyEvent event)
           
(package private)  void OkCancelPreferenceDialog_WindowClosing(WindowEvent event)
           
private  void processCancelAction()
           
private  void processOkAction()
           
(package private)  void promptCheckbox_KeyPressed(KeyEvent event)
           
 void removeActionListener(ActionListener l)
          Method removeActionListener removes the given listener from receiving notification of ActionEvents on this dialog.
 void setCheckboxDefault(boolean default_state)
          Sets the default state of the checkbox.
private  void setContext(boolean context_on)
           
 void setDisplayMessage(String message)
          Sets the message to display as the message of this dialog
 void setPreferenceName(String preference)
          Sets the String name of the preference to be used by this dialog when prompting the user.
 void setPromptCheckboxLabel(String label)
          Sets the label to display with the checkbox.
 void setUseOppositeState(boolean use_opposite)
          Specifies whether the preference should be set based on the state of the checkbox or the opposite of the state of the checkbox.
 void setVisible(boolean b)
          Shows or hides the component depending on the boolean flag b.
 
Methods inherited from class java.awt.Dialog
dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fComponentsAdjusted

boolean fComponentsAdjusted

messagePanel

Panel messagePanel

messageLabel

symantec.itools.awt.WrappingLabel messageLabel

checkboxPanel

Panel checkboxPanel

promptCheckbox

Checkbox promptCheckbox

horizontalLine1

symantec.itools.awt.shape.HorizontalLine horizontalLine1

buttonPanel

Panel buttonPanel

okButton

Button okButton

cancelButton

Button cancelButton

OK

public static final int OK
See Also:
Constant Field Values

CANCEL

public static final int CANCEL
See Also:
Constant Field Values

contextGroup

private ThreadGroup contextGroup

action

private int action

listeners

private Vector listeners

preference

private String preference

usePreferenceForDefault

private boolean usePreferenceForDefault

useOppositeState

private boolean useOppositeState

RESOURCES

protected static String RESOURCES

OK_COMMAND

public static String OK_COMMAND
Defined constant which indicates a positive response by the user to the displayed message


CANCEL_COMMAND

public static String CANCEL_COMMAND
Defined constant which indicates a negative response by the user to the displayed message

Constructor Detail

OkCancelPreferenceDialog

public OkCancelPreferenceDialog(Frame parent)

OkCancelPreferenceDialog

public OkCancelPreferenceDialog(Frame parent,
                                boolean modal)

OkCancelPreferenceDialog

public OkCancelPreferenceDialog(Frame parent,
                                String title,
                                boolean modal)

OkCancelPreferenceDialog

public OkCancelPreferenceDialog(Frame parent,
                                boolean modal,
                                String preference)
                         throws WTException
Method Detail

addNotify

public void addNotify()

setVisible

public void setVisible(boolean b)
Shows or hides the component depending on the boolean flag b.

Parameters:
b - if true, show the component; otherwise, hide the component.
See Also:
Component.isVisible()

OkCancelPreferenceDialog_WindowClosing

void OkCancelPreferenceDialog_WindowClosing(WindowEvent event)

isShowPrompt

public boolean isShowPrompt()
                     throws WTException
Throws:
WTException

getPreference

public boolean getPreference()
                      throws WTException
Throws:
WTException

processOkAction

private void processOkAction()
                      throws WTException
Throws:
WTException

setContext

private void setContext(boolean context_on)

getContext

private WTContext getContext()

notifyActionListeners

private void notifyActionListeners(ActionEvent evt)
                            throws WTException
Throws:
WTException

addActionListener

public void addActionListener(ActionListener l)
Method 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.

Parameters:
l - the ActionListener to be notified of ActionEvents on this dialog
See Also:
ActionListener, removeActionListener(java.awt.event.ActionListener)

removeActionListener

public void removeActionListener(ActionListener l)
Method 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.

Parameters:
l - the ActionListener to be removed from being notified of ActionEvents on this dialog
See Also:
ActionListener, addActionListener(java.awt.event.ActionListener)

getAction

public int getAction()
Method getAction returns the action invoked by the user on this dialog.

Returns:
OkCancelDialog.OK, if the user invokes the OK action; or OkCancelDialog.CANCEL, if the user invokes the Cancel action

processCancelAction

private void processCancelAction()
                          throws WTException
Throws:
WTException

okButton_ActionPerformed

void okButton_ActionPerformed(ActionEvent event)
                        throws WTException
Throws:
WTException

cancelButton_ActionPerformed

void cancelButton_ActionPerformed(ActionEvent event)
                            throws WTException
Throws:
WTException

okButton_KeyPressed

void okButton_KeyPressed(KeyEvent event)
                   throws WTException
Throws:
WTException

cancelButton_KeyPressed

void cancelButton_KeyPressed(KeyEvent event)
                       throws WTException
Throws:
WTException

setPreferenceName

public void setPreferenceName(String preference)
                       throws WTException
Sets the String name of the preference to be used by this dialog when prompting the user.

Parameters:
preference - the String name of the preference which could be set or modified by this dialog
Throws:
WTException

getPreferenceName

public String getPreferenceName()
Returns the String name of the preference used by this dialog when prompting the user.

Returns:
the String preference used by this dialog

setPromptCheckboxLabel

public void setPromptCheckboxLabel(String label)
Sets the label to display with the checkbox.

Parameters:
label - the String label to display as the text of the checkbox

setCheckboxDefault

public void setCheckboxDefault(boolean default_state)
Sets the default state of the checkbox. By default, the checkbox will use the value of the preference to set the default state of the checkbox. If this method is invoked, the default value of the preference will not be used to set the default state for the checkbox.

Parameters:
default_state - the default state of the checkbox.

setDisplayMessage

public void setDisplayMessage(String message)
Sets the message to display as the message of this dialog

Parameters:
message - the String message to display

initializeCheckboxState

private void initializeCheckboxState()
                              throws WTException
Initializes the state of the checkbox with the value of the user preference.

Throws:
WTException

setUseOppositeState

public void setUseOppositeState(boolean use_opposite)
                         throws WTException
Specifies whether the preference should be set based on the state of the checkbox or the opposite of the state of the checkbox.

Parameters:
use_opposite - if true, the preference is set using the logical not of the state of the checkbox; otherwise, the preference is using the state of the checkbox
Throws:
WTException

localize

protected void localize()
Localize the button labels


promptCheckbox_KeyPressed

void promptCheckbox_KeyPressed(KeyEvent event)
                         throws WTException
Throws:
WTException