|
||||||||||
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.metamatrix.toolbox.ui.widget.DialogWindow
public class DialogWindow
This class is intended to be used everywhere within the application that a dialog needs to be displayed. It may only be used with a DialogPanel, which must be specified in the constructor. By default, this class acts as the controller for the accept and cancel buttons within the contained DialogPanel. The default action for each of these buttons is to dispose the dialog.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JDialog |
---|
javax.swing.JDialog.AccessibleJDialog |
Nested classes/interfaces inherited from class java.awt.Dialog |
---|
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static boolean |
IS_MODAL
|
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 | |
---|---|
DialogWindow(java.awt.Dialog owner,
java.lang.String title,
DialogPanel panel)
Creates a modal dialog with the specified title, that will be displayed by the specified dialog. |
|
DialogWindow(java.awt.Dialog owner,
java.lang.String title,
DialogPanel panel,
boolean isModal)
Creates a dialog with the specified title and modality, that will be displayed by the specified dialog. |
|
DialogWindow(java.awt.Frame owner,
java.lang.String title,
DialogPanel panel)
Creates a modal dialog with the specified title, that will be displayed by the specified frame. |
|
DialogWindow(java.awt.Frame owner,
java.lang.String title,
DialogPanel panel,
boolean isModal)
Creates a dialog with the specified title and modality, that will be displayed by the specified frame. |
Method Summary | |
---|---|
protected void |
accept(java.awt.event.ActionEvent event)
Called when the user activates the accept button. |
protected void |
cancel(java.awt.AWTEvent event)
Called when the user activates the cancel button or cancels the dialog via the title bar close button (with the 'X' icon) or the title bar system menu 'Close' option. |
static void |
disposeConditionally(java.awt.Window window,
java.awt.AWTEvent event)
Disposes the specified window as long as the specified event is not a WidgetActionEvent or has not been destroyed. |
DialogPanel |
getDialogPanel()
|
protected static java.awt.Dimension |
getDimensionFromPreferences(java.lang.String propertyName)
|
static DialogWindow |
getInstance(java.awt.Component parent,
java.lang.String title,
java.awt.Component content)
|
protected void |
initializeDialogWindow()
Initializes the dialog: Adds the dlgPanel to the center of the dialog Centers dialog relative to its owner Adds listeners to the DialogPanel's accept and cancel buttons that call the accept and cancel methods, respectively, within this class Ties window close button ('X' button) to the cancel button's action |
protected void |
processWindowEvent(java.awt.event.WindowEvent event)
Overridden to call the cancel() method in the event that the user cancels the window via its close button (the 'X' icon) or the 'Close' option in the system menu. |
static void |
setSizeToPreferences(boolean flag)
|
static DialogPanel |
show(java.awt.Component parent,
java.lang.String title,
java.awt.Component content)
|
static DialogPanel |
show(DialogWindow dialog)
|
protected static void |
storeDimensionFromPreferences(java.lang.String propertyName,
java.awt.Dimension size)
|
protected void |
unregisterListeners()
Unregisters the listeners for the accept and cancel buttons that callback to the contained DialogPanel to determine
if the this dialog may be disposed. |
Methods inherited from class javax.swing.JDialog |
---|
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.awt.Dialog |
---|
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean IS_MODAL
Constructor Detail |
---|
public DialogWindow(java.awt.Frame owner, java.lang.String title, DialogPanel panel)
owner
- The window that displayed the dialogtitle
- The dialog's titlepanel
- The contained DialogPanelpublic DialogWindow(java.awt.Dialog owner, java.lang.String title, DialogPanel panel)
owner
- The window that displayed the dialogtitle
- The dialog's titlepanel
- The contained DialogPanelpublic DialogWindow(java.awt.Frame owner, java.lang.String title, DialogPanel panel, boolean isModal)
owner
- The window that displayed the dialogtitle
- The dialog's titlepanel
- The contained DialogPanelisModal
- Indicates whether the dialog is modalpublic DialogWindow(java.awt.Dialog owner, java.lang.String title, DialogPanel panel, boolean isModal)
owner
- The window that displayed the dialogtitle
- The dialog's titlepanel
- The contained DialogPanelisModal
- Indicates whether the dialog is modalMethod Detail |
---|
public static void disposeConditionally(java.awt.Window window, java.awt.AWTEvent event)
window
- The window to be disposedevent
- The event triggering the window's disposalprotected static java.awt.Dimension getDimensionFromPreferences(java.lang.String propertyName)
public static DialogWindow getInstance(java.awt.Component parent, java.lang.String title, java.awt.Component content)
public static void setSizeToPreferences(boolean flag)
public static DialogPanel show(DialogWindow dialog)
public static DialogPanel show(java.awt.Component parent, java.lang.String title, java.awt.Component content)
protected static void storeDimensionFromPreferences(java.lang.String propertyName, java.awt.Dimension size)
protected void accept(java.awt.event.ActionEvent event)
event
- The WidgetActionEvent generated from activating the buttonprotected void cancel(java.awt.AWTEvent event)
event
- The WidgetActionEvent generated from activating the button or closing the windowpublic DialogPanel getDialogPanel()
protected void initializeDialogWindow()
protected void processWindowEvent(java.awt.event.WindowEvent event)
processWindowEvent
in class javax.swing.JDialog
event
- The window event to be processedprotected void unregisterListeners()
DialogPanel
to determine
if the this dialog may be disposed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |