JIDE 3.5.15

com.jidesoft.dialog
Class StandardDialog

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by com.jidesoft.dialog.StandardDialog
All Implemented Interfaces:
ButtonNames, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
AddCalculatedColumnDialog, AggregateTableSettingsDialog, ClipboardsDialog, CustomFilterEditorDialog, FindAndReplaceDialog, MultiplePageDialog, OutlookTabbedPane.OptionDialog, PromptDialog, TableColumnChooserDialog, TipOfTheDayDialog, WizardDialog

public abstract class StandardDialog
extends JDialog
implements ButtonNames

StandardDialog is a dialog template. However several things are added to it to make it easier to use.

This class is abstract. Subclasses need to implement createBannerPanel(), createButtonPanel() and createContentPanel()

See Also:
Serialized Form

Nested Class Summary
protected  class StandardDialog.DefaultStandardDialogPane
           
 
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
 com.jidesoft.dialog.StandardDialog.StandardDialogPropertyChangeListener _propertyChangeListener
           
protected  StandardDialogPane _standardDialogPane
           
static int RESULT_AFFIRMED
          Dialog result.
static int RESULT_CANCELLED
          Dialog result.
 
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 com.jidesoft.dialog.ButtonNames
APPLY, BACK, BROWSE, CANCEL, CLEAR, CLOSE, DETAILS, EDIT, EXIT, FIND, FIND_NEXT, FINISH, FORWARD, HELP, NEW, NEXT, NO, OK, OPEN, PRINT, REPLACE, RESET, RETRY, RUN, SAVE, SAVE_AS, STOP, YES
 
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
StandardDialog()
           
StandardDialog(Dialog owner, boolean modal)
           
StandardDialog(Dialog owner, String title)
           
StandardDialog(Dialog owner, String title, boolean modal)
           
StandardDialog(Dialog owner, String title, boolean modal, GraphicsConfiguration gc)
           
StandardDialog(Frame owner)
           
StandardDialog(Frame owner, boolean modal)
           
StandardDialog(Frame owner, String title)
           
StandardDialog(Frame owner, String title, boolean modal)
           
StandardDialog(Window owner)
           
StandardDialog(Window owner, String title)
           
 
Method Summary
abstract  JComponent createBannerPanel()
          Subclasses should implement this method to create the banner panel.
abstract  ButtonPanel createButtonPanel()
          Subclasses should implement this method to create the button panel.
abstract  JComponent createContentPanel()
          Subclasses should implement this method to create the content panel.
 ButtonPanel createOKCancelButtonPanel()
          Creates a standard OK/Cancel button panel.
protected  StandardDialogPane createStandardDialogPane()
           
 JComponent getBannerPanel()
          Gets the banner panel created by createBannerPanel.
 ButtonPanel getButtonPanel()
          Gets the banner panel created by createButtonPanel.
 JComponent getContentPanel()
          Gets the banner panel created by createContentPanel.
 Action getDefaultAction()
          Gets the default action.
 Action getDefaultCancelAction()
          Get default cancel action.
 int getDialogResult()
          Gets the result.
 Component getInitFocusedComponent()
          Gets the initial focused component when dialog is shown.
 StandardDialogPane getStandardDialogPane()
           
protected  void initComponents()
          Call three createXxxPanel methods and layout them using BorderLayout.
 void initialize()
          Force the initComponent() method implemented in the child class to be called.
 void pack()
           
 void setDefaultAction(Action defaultAction)
          Sets the default action.
 void setDefaultCancelAction(Action defaultCancelAction)
          Set default cancel action.
 void setDialogResult(int dialogResult)
          Sets the dialog result.
 void setInitFocusedComponent(Component initFocusedComponent)
          Sets the initial focused component when dialog is shown.
 void show()
          Deprecated. As of JDK version 1.5, replaced by Component.setVisible(boolean).
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, 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, 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, paint, 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, 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

_standardDialogPane

protected StandardDialogPane _standardDialogPane

RESULT_CANCELLED

public static final int RESULT_CANCELLED
Dialog result.

See Also:
Constant Field Values

RESULT_AFFIRMED

public static final int RESULT_AFFIRMED
Dialog result.

See Also:
Constant Field Values

_propertyChangeListener

public com.jidesoft.dialog.StandardDialog.StandardDialogPropertyChangeListener _propertyChangeListener
Constructor Detail

StandardDialog

public StandardDialog()
               throws HeadlessException
Throws:
HeadlessException

StandardDialog

public StandardDialog(Frame owner)
               throws HeadlessException
Throws:
HeadlessException

StandardDialog

public StandardDialog(Frame owner,
                      boolean modal)
               throws HeadlessException
Throws:
HeadlessException

StandardDialog

public StandardDialog(Frame owner,
                      String title)
               throws HeadlessException
Throws:
HeadlessException

StandardDialog

public StandardDialog(Frame owner,
                      String title,
                      boolean modal)
               throws HeadlessException
Throws:
HeadlessException

StandardDialog

public StandardDialog(Window owner)
               throws HeadlessException
Throws:
HeadlessException

StandardDialog

public StandardDialog(Window owner,
                      String title)
               throws HeadlessException
Throws:
HeadlessException

StandardDialog

public StandardDialog(Dialog owner,
                      boolean modal)
               throws HeadlessException
Throws:
HeadlessException

StandardDialog

public StandardDialog(Dialog owner,
                      String title)
               throws HeadlessException
Throws:
HeadlessException

StandardDialog

public StandardDialog(Dialog owner,
                      String title,
                      boolean modal)
               throws HeadlessException
Throws:
HeadlessException

StandardDialog

public StandardDialog(Dialog owner,
                      String title,
                      boolean modal,
                      GraphicsConfiguration gc)
               throws HeadlessException
Throws:
HeadlessException
Method Detail

getDialogResult

public int getDialogResult()
Gets the result.

Returns:
the result.

setDialogResult

public void setDialogResult(int dialogResult)
Sets the dialog result.

Parameters:
dialogResult - the new dialog result.

getDefaultCancelAction

public Action getDefaultCancelAction()
Get default cancel action. Default cancel action will be triggered when ESC is pressed.

Returns:
the default cancel action

setDefaultCancelAction

public void setDefaultCancelAction(Action defaultCancelAction)
Set default cancel action. Default cancel action will be triggered when ESC is pressed.

Parameters:
defaultCancelAction - the default cancel action

getDefaultAction

public Action getDefaultAction()
Gets the default action. Default action will be trigger when ENTER key is pressed.

Returns:
the default action.

setDefaultAction

public void setDefaultAction(Action defaultAction)
Sets the default action. Default action will be trigger when ENTER key is pressed.

Parameters:
defaultAction - the default action.

pack

public void pack()
Overrides:
pack in class Window

show

@Deprecated
public void show()
Deprecated. As of JDK version 1.5, replaced by Component.setVisible(boolean).

Overrides:
show in class Dialog

initialize

public final void initialize()
Force the initComponent() method implemented in the child class to be called. If this method is called more than once on a given object, all calls but the first do nothing.


initComponents

protected void initComponents()
Call three createXxxPanel methods and layout them using BorderLayout. By default, banner panel, content panel and button panel are added to NORTH, CENTER and SOUTH of BorderLayout respectively.

You can override this method if you want to layout them in another way.


getInitFocusedComponent

public Component getInitFocusedComponent()
Gets the initial focused component when dialog is shown.

Returns:
the initial focused component

setInitFocusedComponent

public void setInitFocusedComponent(Component initFocusedComponent)
Sets the initial focused component when dialog is shown.

Parameters:
initFocusedComponent - the initial focused component.

getBannerPanel

public JComponent getBannerPanel()
Gets the banner panel created by createBannerPanel.

Returns:
the banner panel.

getContentPanel

public JComponent getContentPanel()
Gets the banner panel created by createContentPanel.

Returns:
the content panel.

getButtonPanel

public ButtonPanel getButtonPanel()
Gets the banner panel created by createButtonPanel.

Returns:
the button panel.

getStandardDialogPane

public StandardDialogPane getStandardDialogPane()

createBannerPanel

public abstract JComponent createBannerPanel()
Subclasses should implement this method to create the banner panel. By default banner panel will appear on top of the dialog unless you override initComponent() method. Banner panel is really used to balance the layout of dialog to make the dialog looking good. However it can be used to show some help text. It is highly recommended to use our BannerPanel

If subclass doesn't want to have a banner panel, just return null.

Returns:
the banner panel.

createContentPanel

public abstract JComponent createContentPanel()
Subclasses should implement this method to create the content panel. This is the main panel of the dialog which will be added to the center of the dialog. Subclass should never return null.

Returns:
the content panel.

createButtonPanel

public abstract ButtonPanel createButtonPanel()
Subclasses should implement this method to create the button panel. 90% of dialogs have buttons. It is highly recommended to use our ButtonPanel.

Returns:
the button panel.
See Also:
ButtonPanel

createOKCancelButtonPanel

public ButtonPanel createOKCancelButtonPanel()
Creates a standard OK/Cancel button panel.

Returns:
a button panel that has OK/Cancel button.

createStandardDialogPane

protected StandardDialogPane createStandardDialogPane()

JIDE 3.5.15