|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container net.xoetrope.xui.XPage net.xoetrope.awt.XDialog
public class XDialog
Provides support for Popups. This class extends XPage 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.
This dialog differs from the built-in Dialog class as it displays an embedded Xpage instance. In this way the dialog content can be created like any other XUI page
Copyright (c) Xoetrope Ltd., 1998-2004
License: see license.txt
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.xoetrope.xui.XPage |
---|
XPage.IXDialog |
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
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 XPanel |
contentPanel The 'content' panel that holds the dialog's XPage |
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 net.xoetrope.xui.XPage |
---|
ACTIVATED, adapter, ANNOTATEDIMAGE, antiAlias, BORDER_LAYOUT, BOX_LAYOUT, BUTTON, CARD_LAYOUT, CHECK, COMBO, componentFactory, CREATED, DEACTIVATED, DISCARDED, EDIT, FLOW_LAYOUT, GRID_LAYOUT, GRIDBAG_LAYOUT, GROUP, GUIDE_LAYOUT, HOTSPOTIMAGE, IMAGE, IMAGEMAP, LABEL, LIST, LOADED, MENU, MENUBAR, MENUITEM, METACONTENT, NULL_LAYOUT, pageHelper, pageMgr, PANEL, PASSWORD, project, RADIO, rootModel, SCALE_LAYOUT, SCROLLABLEMETACONTENT, SCROLLPANE, SPLITPANE, SPRING_LAYOUT, TABLE, TABPANEL, TEXTAREA, UNKNOWN, UNKNOWN_PAGE_STATE, WMF, XUI_AWT_PACKAGE, XUI_HTML_PACKAGE, XUI_SWING_PACKAGE, XUI_SWT_PACKAGE |
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 | |
---|---|
XDialog() Creates a new dialog and adds a content panel to the page. |
|
XDialog(boolean modal, int pad) Creates a new dialog and adds a content panel to the page. |
Method Summary | |
---|---|
void |
cancelDlg() Dismiss the dialog and discard the data. |
void |
closeDlg() Close the dialog and restore focus |
java.lang.Object |
getContentPane() Get the 'content' pane |
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 minimumsize for the dialog |
java.awt.Dimension |
getPreferredSize() Set the preferred size for the component |
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 XPage 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 |
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). |
void |
showDialog(java.awt.Component callBackParent, java.lang.String callBackMethod) Shows the dialog. |
int |
showDialog(java.awt.Container owner) Shows the dialog. |
int |
showDialog(java.awt.Container owner, java.lang.String title, java.awt.Point location) Shows the dialog. |
void |
showModalWindow(java.awt.Component contents) Shows the dialog as a modal window |
boolean |
wasMouseClicked() A utility method used to determine if the last event corrseponds to a mouse click. |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, 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, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setVisible, 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 net.xoetrope.xui.PageSupport |
---|
doLayout, getName, setLocation, setName, setVisible, validate |
Field Detail |
---|
public static final boolean trueField
public static final int DEFAULT_PADDING
public static final int NOTHING_CLICKED_YET
public static final int OK_CLICKED
public static final int CANCEL_CLICKED
public static final int CLOSE_CLICKED
public static final int NO_CLICKED
protected boolean saveOnClose
protected int returnValue
protected static int lastReturnValue
public java.lang.Object returnObject
protected XPanel contentPanel
protected int padding
protected java.awt.Component focusComponent
protected int closeButtonID
Constructor Detail |
---|
public XDialog()
public XDialog(boolean modal, int pad)
modal
- true for a modal dialogpad
- the amount of padding in pixels with which to surround the page within the dialog frameMethod Detail |
---|
public void setBackground(java.awt.Color c)
PageSupport
setBackground
in interface PageSupport
setBackground
in class java.awt.Component
c
- The colorpublic void setForeground(java.awt.Color c)
setForeground
in class java.awt.Component
public void setFont(java.awt.Font f)
setFont
in class java.awt.Container
public static int getLastReturnValue()
public java.lang.Object getContentPane()
getContentPane
in interface XContentPane
public void pageCreated()
pageCreated
in interface PageSupport
pageCreated
in class XPage
public void pack()
public void setCaption(java.lang.String c)
c
- the new caption of dialog titlepublic java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Container
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Container
public void setUseNativeHeaders(boolean bh)
bh
- true to use native decorations.public void setModal(boolean modal)
modal
- true for a modal dialogpublic void setSaveOnClose(boolean save)
save
- true to save the data when the dialog is closed or dismissed, false to discard the data.public void setResizable(boolean state)
state
- true for a resizable dialogsetUseNativeHeaders
public void cancelDlg()
public void closeDlg()
public int showDialog(java.awt.Container owner, java.lang.String title, java.awt.Point location)
owner
- The container to which the dialog is added.title
- The dialog title/captionlocation
- The location on screen to show the dialogpublic void showDialog(java.awt.Component callBackParent, java.lang.String callBackMethod)
callBackParent
- The parent/owner for purposes of a callback.callBackMethod
- The name of a callback method in the parent (or null) to be invoked when the dialog is dismissed.public int showDialog(java.awt.Container owner)
owner
- The container to which the dialog is added.public void setSize(int width, int height)
setSize
in interface PageSupport
setSize
in class java.awt.Component
width
- The new widthheight
- The new heightpublic void setLocation(java.awt.Point location)
setLocation
in class java.awt.Component
location
- the point on screen at which the dialog is to be shown.protected java.awt.Component getFocusComponent(java.awt.Container cont)
cont
- the container to be checked for focus.public java.lang.Object getReturnObject()
public boolean wasMouseClicked()
wasMouseClicked
in interface PageSupport
wasMouseClicked
in class XPage
public void showModalWindow(java.awt.Component contents)
contents
- the contents of the new dialog
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |