org.formaria.swing
Class Dialog

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.formaria.swing.layer.LayerManager
                      extended by org.formaria.swing.Page
                          extended by org.formaria.swing.Dialog
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, ContentPane, DialogSupport, ExceptionHandler, ILayerManager, PageSupport, PageSupport.IDialog, PersistentState
Direct Known Subclasses:
DateChooserDialog, LanguageChooserDialog, LanguageChooserDialog, MessageBox, PasswordDlg, PojoDialog

public class Dialog
extends Page
implements ContentPane, PageSupport.IDialog, DialogSupport

Provides support for Popups. This class extends Page giving a blank panel on which you can create custom dialogs. The dialog can be shown as a modal dialog which will block execution of the client code till the dialog is dismissed.

The Dialog is a form of page, however it contains a panel to which all the children are added. The panel is setup with a null layout as is normal and the pack method should be used to calculate the size of the dialog.

The Dialog is then added to a border layout contained in either a window or a dialog. This parent also contains the window decorations

.

Copyright: Copyright (c) Formaria Ltd., 2008
License: see license.txt

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
 
Nested classes/interfaces inherited from interface org.formaria.aria.PageSupport
PageSupport.IDialog
 
Field Summary
protected  boolean bIsModal
          A flag indicating whether or not the dialog is modal
static int BUTTON_SIZE
           
static int CANCEL_CLICKED
          A state flag indicating that the CANCEL button was clicked
static int CLOSE_CLICKED
          A state flag indicating that the CLOSE button was clicked
protected  int closeButtonID
          Was the close button clicked
protected  Panel contentPanel
          The 'content' panel that holds the dialog's Page
static int DEFAULT_PADDING
          The default dialog padding.
protected  java.awt.Component focusComponent
          The component that had focus prior to display of the dialog.
protected static int lastReturnValue
          The last return value
static int NO_CLICKED
          A state flag indicating that the NO button was clicked
static int NOTHING_CLICKED_YET
          A state flag indicating that no button clicked so far
static int OK_CLICKED
          A state flag indicating that the OK button was clicked
protected  int padding
          The current dialog padding
 java.lang.Object returnObject
          The return value, a user defined value
protected  int returnValue
          The return value, indicating which button was clicked
protected  boolean saveOnClose
          A flag indicating whether or not the dialog automatically saves its data when it is closed
static boolean trueField
          A boolean value used for checking a 'true' value
 
Fields inherited from class org.formaria.swing.Page
adapter, componentFactory, pageHelper, pageMgr, project, rootModel
 
Fields inherited from class org.formaria.swing.layer.LayerManager
BACKGROUND
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface org.formaria.aria.PageSupport
ACTIVATED, ANNOTATEDIMAGE, ARIA_AWT_PACKAGE, ARIA_HTML_PACKAGE, ARIA_SWING_PACKAGE, ARIA_SWT_PACKAGE, BORDER_LAYOUT, BOX_LAYOUT, BUTTON, CARD_LAYOUT, CHECK, COLUMN_LAYOUT, COMBO, CREATED, DEACTIVATED, DISCARDED, DISPLAYED, EDIT, FLOW_LAYOUT, GRID_LAYOUT, GRIDBAG_LAYOUT, GROUP, GUIDE_LAYOUT, HOTSPOTIMAGE, IMAGE, IMAGEMAP, LABEL, LAYER_LAYOUT, LIST, LOADED, MENU, MENUBAR, MENUITEM, METACONTENT, NULL_LAYOUT, PANEL, PASSWORD, RADIO, SCALE_LAYOUT, SCROLLABLEMETACONTENT, SCROLLPANE, SPLITPANE, SPRING_LAYOUT, TABLE, TABPANEL, TEXTAREA, UNKNOWN, UNKNOWN_PAGE_STATE, WMF
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Dialog()
          Creates a new dialog and adds a content panel to the page.
Dialog(boolean modal, int pad)
          Creates a new dialog and adds a content panel to the page.
 
Method Summary
 java.awt.Component add(java.awt.Component c)
          Add a component - this method should not normally be used.
 void cancelDlg()
          Dismiss the dialog and discard the data.
 void closeDlg()
          Close the dialog and restore focus
 java.lang.Object getContentPane()
          The 'content' pane to which the pages are added
protected  java.awt.Component getFocusComponent(java.awt.Container cont)
          Gets the component that owns the focus.
static int getLastReturnValue()
          Get the return value of the most recently dismissed dialog
 java.awt.Dimension getMinimumSize()
          Get the minimum layout size
 java.awt.Dimension getPreferredSize()
          Get the preferred layout size
 java.lang.Object getReturnObject()
          Provides access to an object representing the state of the dialog when it was closed.
 void pack()
          Size the dialog to hold the largest components (i.e.
 void pageCreated()
          Overload the Page XCreated event and set the caption of the dialog from the title attribute.
 void setBackground(java.awt.Color c)
          Set the background color
 void setCaption(java.lang.String c)
          Set the dialog caption/title
 void setFont(java.awt.Font f)
           
 void setForeground(java.awt.Color c)
           
 void setHideFrame(boolean hide)
          Set flag to indicate whether to paint the border and add the title panel
 void setLayout(java.awt.LayoutManager lm)
          Set the layout manager for the content pane
 void setLocation(int x, int y)
          Set the location of the dialog window
 void setLocation(java.awt.Point location)
          Set the location of the dialog window
 void setModal(boolean modal)
          Set the dialog to be modal or non-modal
 void setResizable(boolean state)
          Set the resizable property.
 void setSaveOnClose(boolean save)
          Set the save on close option
 void setSize(int width, int height)
          Set the size of the dialog and centres it within the parent.
 void setUseNativeHeaders(boolean bh)
          Set the dialog to use the native platform decorations (title bar and borders).
 int showDialog(java.lang.Object owner)
          Shows the dialog.
 int showDialog(java.lang.Object cbParent, java.lang.String cb)
          Shows the dialog.
 int showDialog(java.lang.Object owner, java.lang.String title, java.awt.Point location)
          Shows the dialog.
 void showModalWindow(java.awt.Component contents)
          Show the dialog ina modal way
 boolean wasMouseClicked()
          A utility method used to determine if the last event corrseponds to a mouse click.
 
Methods inherited from class org.formaria.swing.Page
accumulateMessages, addBinding, addHandler, addHandler, addListener, addNestedPage, addNotify, addValidation, addValidation, addValidation, checkValidations, clearMouseClick, clearValidations, enterDataBindingContext, evaluateAttribute, evaluatePath, exitDataBindingContext, findComponent, findComponent, getAttribute, getAttribute, getAttributes, getBinding, getBinding, getBindings, getComponentFactory, getComponentName, getCurrentEvent, getDataBindingContext, getDataBindingContext, getEventAttribute, getEventHandler, getExtension, getGraphics, getOwner, getPageName, getPageSize, getProject, getStatus, getValidationHandler, handleEventHandlerException, handleException, isFocusChangeSuppressed, layout, pageActivated, pageAdded, pageDeactivated, paint, paintSuper, removeBinding, restoreState, saveBoundComponentValues, saveState, setAttribute, setClearPage, setComponentFactory, setEventHandler, setExceptionHandler, setExtension, setLayout, setPageName, setStatus, setValidationFactory, showComponents, showHandCursor, showMessage, showMessage, showPage, showPage, showPrevious, stripAttributeValues, translate, update, updateBinding, updateBindings, updateBoundComponentValues, updateChildLayouts, validationHandler, wasEnterPressed, wasMouseDoubleClicked, wasMouseRightClicked
 
Methods inherited from class org.formaria.swing.layer.LayerManager
add, add, add, add, addLayer, deleteLayer, getActiveLayer, getActiveLayerIndex, getComponent, getInputContext, getLayer, getLayer, getLayerNames, isEnabled, isFocusable, isLayerEnabled, isLayerEnabled, isLayerVisible, moveLayerDown, moveLayerUp, paintChildren, setActiveLayer, setBounds, setLayerEnabled, setLayerName, setLayerVisible, updateLayerSizes
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction
 
Methods inherited from class java.awt.Container
addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setName, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.formaria.aria.PageSupport
accumulateMessages, addBinding, addHandler, addHandler, addListener, addNestedPage, addValidation, addValidation, addValidation, checkValidations, clearValidations, doLayout, enterDataBindingContext, evaluateAttribute, evaluatePath, exitDataBindingContext, findComponent, findComponent, getAttribute, getAttribute, getBinding, getBinding, getBindings, getComponentFactory, getComponentName, getCurrentEvent, getDataBindingContext, getDataBindingContext, getEventAttribute, getEventHandler, getExtension, getName, getOwner, getPageSize, getProject, getStatus, getValidationHandler, handleEventHandlerException, handleException, isFocusChangeSuppressed, pageActivated, pageAdded, pageDeactivated, removeBinding, saveBoundComponentValues, setAttribute, setClearPage, setComponentFactory, setEventHandler, setExceptionHandler, setExtension, setLayout, setName, setStatus, setValidationFactory, setVisible, showComponents, showHandCursor, showMessage, showMessage, stripAttributeValues, translate, updateBinding, updateBindings, updateBoundComponentValues, validate, validationHandler, wasMouseDoubleClicked, wasMouseRightClicked
 
Methods inherited from interface org.formaria.aria.PersistentState
restoreState, saveState
 

Field Detail

BUTTON_SIZE

public static final int BUTTON_SIZE
See Also:
Constant Field Values

trueField

public static final boolean trueField
A boolean value used for checking a 'true' value

See Also:
Constant Field Values

DEFAULT_PADDING

public static final int DEFAULT_PADDING
The default dialog padding. the padding indents the content page within the dialog frame

See Also:
Constant Field Values

NOTHING_CLICKED_YET

public static final int NOTHING_CLICKED_YET
A state flag indicating that no button clicked so far

See Also:
Constant Field Values

OK_CLICKED

public static final int OK_CLICKED
A state flag indicating that the OK button was clicked

See Also:
Constant Field Values

CANCEL_CLICKED

public static final int CANCEL_CLICKED
A state flag indicating that the CANCEL button was clicked

See Also:
Constant Field Values

CLOSE_CLICKED

public static final int CLOSE_CLICKED
A state flag indicating that the CLOSE button was clicked

See Also:
Constant Field Values

NO_CLICKED

public static final int NO_CLICKED
A state flag indicating that the NO button was clicked

See Also:
Constant Field Values

bIsModal

protected boolean bIsModal
A flag indicating whether or not the dialog is modal


saveOnClose

protected boolean saveOnClose
A flag indicating whether or not the dialog automatically saves its data when it is closed


returnValue

protected int returnValue
The return value, indicating which button was clicked


lastReturnValue

protected static int lastReturnValue
The last return value


returnObject

public java.lang.Object returnObject
The return value, a user defined value


contentPanel

protected Panel contentPanel
The 'content' panel that holds the dialog's Page


padding

protected int padding
The current dialog padding


focusComponent

protected java.awt.Component focusComponent
The component that had focus prior to display of the dialog. The dialog attempts to restore focus to this component when dismissed


closeButtonID

protected int closeButtonID
Was the close button clicked

Constructor Detail

Dialog

public Dialog()
Creates a new dialog and adds a content panel to the page. A handler is also set so that the dialog will be dismissed when the escape key is pressed.


Dialog

public Dialog(boolean modal,
              int pad)
Creates a new dialog and adds a content panel to the page. A handler is also set so that the dialog will be dismissed when the escape key is pressed.

Parameters:
modal - true for a modal dialog
pad - the amount of padding in pixels
Method Detail

pageCreated

public void pageCreated()
Overload the Page XCreated event and set the caption of the dialog from the title attribute. Call super if overloaded.

Specified by:
pageCreated in interface PageSupport
Overrides:
pageCreated in class Page

add

public java.awt.Component add(java.awt.Component c)
Add a component - this method should not normally be used. Instead add to the content pane getContentPane().add(...)

Specified by:
add in interface ILayerManager
Overrides:
add in class LayerManager
Parameters:
c - the component to add
Returns:
the added component
See Also:
Container.addImpl(java.awt.Component, java.lang.Object, int), Container.validate(), JComponent.revalidate()

setLayout

public void setLayout(java.awt.LayoutManager lm)
Set the layout manager for the content pane

Overrides:
setLayout in class LayerManager
Parameters:
lm - the layout manager
See Also:
Container.doLayout(), Container.getLayout()

setBackground

public void setBackground(java.awt.Color c)
Description copied from interface: PageSupport
Set the background color

Specified by:
setBackground in interface PageSupport
Overrides:
setBackground in class javax.swing.JComponent
Parameters:
c - The color

setForeground

public void setForeground(java.awt.Color c)
Overrides:
setForeground in class javax.swing.JComponent

setHideFrame

public void setHideFrame(boolean hide)
Set flag to indicate whether to paint the border and add the title panel

Parameters:
hide - if set to true don't add the title panel and don't paint the border

setFont

public void setFont(java.awt.Font f)
Overrides:
setFont in class javax.swing.JComponent

getLastReturnValue

public static int getLastReturnValue()
Get the return value of the most recently dismissed dialog

Returns:
a value indicating the status or the button that was used to dismiss the dialog

getContentPane

public java.lang.Object getContentPane()
The 'content' pane to which the pages are added

Specified by:
getContentPane in interface ContentPane
Returns:
the content pane

pack

public void pack()
Size the dialog to hold the largest components (i.e. children of the content panel)

Specified by:
pack in interface DialogSupport

setCaption

public void setCaption(java.lang.String c)
Set the dialog caption/title

Specified by:
setCaption in interface DialogSupport
Parameters:
c - the new caption

getMinimumSize

public java.awt.Dimension getMinimumSize()
Get the minimum layout size

Overrides:
getMinimumSize in class javax.swing.JComponent
Returns:
the min size

getPreferredSize

public java.awt.Dimension getPreferredSize()
Get the preferred layout size

Overrides:
getPreferredSize in class javax.swing.JComponent
Returns:
the preferred size

setUseNativeHeaders

public void setUseNativeHeaders(boolean bh)
Set the dialog to use the native platform decorations (title bar and borders).

Parameters:
bh - true to use native decorations.

setModal

public void setModal(boolean modal)
Set the dialog to be modal or non-modal

Parameters:
modal - true for a modal dialog

setSaveOnClose

public void setSaveOnClose(boolean save)
Set the save on close option

Parameters:
save - true to save the data when the dialog is closed or dismissed, false to discard the data.

setResizable

public void setResizable(boolean state)
Set the resizable property. The resizing of dialogs only works if native headers are used

Parameters:
state - true for a resizable dialog
Since:
2.0.7
See Also:
setUseNativeHeaders

cancelDlg

public void cancelDlg()
Dismiss the dialog and discard the data.


closeDlg

public void closeDlg()
Close the dialog and restore focus


showDialog

public int showDialog(java.lang.Object owner,
                      java.lang.String title,
                      java.awt.Point location)
Shows the dialog. This method calls showDialog( this ) after setting the title, location and after setting the dialog to a size just large enough to display all its content

Parameters:
owner - The container to which the dialog is added.
title - The dialog title/caption
location - The location on screen to show the dialog
Returns:
the returnValue

showDialog

public int showDialog(java.lang.Object cbParent,
                      java.lang.String cb)
Shows the dialog. For modal dialog the showDialog method blocks till the dialog is dismissed or hidden. This method provides an alternative that does not block execution of the calling thread but instead calls back a method specified as an argument once the dialog has been dismissed. In some VMs such as the Microsoft VM it is not possible to gain access to the EventQueue so as to implement blocking unless the code is loaded from a signed CAB file. If this situtaion occurs an exception is thrown and a non-blocking strategy is used. When the dialog is shown it will attempt to gain focus and upon dismissal focus will be returned to the component that had focus prior to display of the dialog. A special case occurs when the dialog is displayed in response to a focus event handler. The focus event will be processed as normal, allowing transfer of focus but focus handler invocations related to the showing and hiding of the dialog will be suppressed.

Parameters:
cbParent - The parent/owner for purposes of a callback.
cb - The name of a callback method in the parent (or null) to be invoked when the dialog is dismissed.

showDialog

public int showDialog(java.lang.Object owner)
Shows the dialog. For modal dialog this method blocks till the dialog is dismissed or hidden. A subclass can set the returnValue member to indicate the status of the dialog upon dismissal. When the dialog is shown it will attempt to gain focus and upon dismissal focus will be returned to the component that had focus prior to display of the dialog. A special case occurs when the dialog is displayed in response to a focus event handler. The focus event will be processed as normal, allowing transfer of focus but focus handler invocations related to the showing and hiding of the dialog will be suppressed.

Specified by:
showDialog in interface DialogSupport
Parameters:
owner - The container to which the dialog is added.
Returns:
the returnValue

setSize

public void setSize(int width,
                    int height)
Set the size of the dialog and centres it within the parent.

Specified by:
setSize in interface ILayerManager
Specified by:
setSize in interface PageSupport
Overrides:
setSize in class java.awt.Component
Parameters:
width - The new width
height - The new height
See Also:
#getSize, #setBounds

setLocation

public void setLocation(java.awt.Point location)
Set the location of the dialog window

Overrides:
setLocation in class java.awt.Component
Parameters:
location - the point on screen at which the dialog is to be shown.

setLocation

public void setLocation(int x,
                        int y)
Set the location of the dialog window

Specified by:
setLocation in interface PageSupport
Overrides:
setLocation in class java.awt.Component
Parameters:
x - the x coordinate, or -1 for ignore/default location, -2 for centered on screen
y - the y coordinate

getFocusComponent

protected java.awt.Component getFocusComponent(java.awt.Container cont)
Gets the component that owns the focus.

Parameters:
cont - the container to be checked for focus.
Returns:
the focus component or null if the container does not have a component that owns the input focus.

getReturnObject

public java.lang.Object getReturnObject()
Provides access to an object representing the state of the dialog when it was closed. It is the responsibility of the subclass to set this value when it closes.

Returns:
the return object

wasMouseClicked

public boolean wasMouseClicked()
A utility method used to determine if the last event corrseponds to a mouse click. The notion of a click is extended by assuming the a mouse press and release within a single component constitutes a click even if not at the same coordinate. A MouseEvent.MOUSE_CLICKED is only triggered when the press and release are at the same location and this is often inadequate for end-user interaction.

Specified by:
wasMouseClicked in interface PageSupport
Overrides:
wasMouseClicked in class Page
Returns:
true if the mouse was clicked

showModalWindow

public void showModalWindow(java.awt.Component contents)
Show the dialog ina modal way

Parameters:
contents - The dialog's content