|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
net.xoetrope.swt.XSwtPage
net.xoetrope.swt.XDialog
public class XDialog
Provides support for Popups. This class extends XSwtPage 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
| 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. the padding indents the content page within the dialog frame |
protected org.eclipse.swt.widgets.Composite |
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 |
protected org.eclipse.swt.widgets.Shell |
shell
|
static boolean |
trueField
A boolean value used for checking a 'true' value |
static int |
WIDTH_BORDER_CENTER
|
| Fields inherited from class net.xoetrope.swt.XSwtPage |
|---|
adapter, componentFactory, COOLITEM, pageHelper, pageMgr, project, rootModel |
| Fields inherited from class org.eclipse.swt.widgets.Control |
|---|
handle |
| 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. |
protected void |
checkSubclass()
Suppress the subclassing exception |
void |
closeDlg()
Close the dialog and restore focus |
java.lang.Object |
getContentPane()
Get the 'content' pane |
protected java.lang.Object |
getFocusComponent(java.lang.Object 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. |
protected void |
init()
Set the init values |
void |
pack()
Size the dialog to hold the largest components (i.e. children of the content panel) |
void |
pageCreated()
Overload the XPage XCreated event and set the caption of the dialog from the title attribute. |
void |
setBackground(org.eclipse.swt.graphics.Color c)
Record the background color so the contentPanel can be set with it when created |
void |
setCaption(java.lang.String c)
Set the dialog caption/title |
void |
setFont(org.eclipse.swt.graphics.Font f)
Record the font so the contentPanel can be set with it when created |
void |
setForeground(org.eclipse.swt.graphics.Color c)
Record the foreground color so the contentPanel can be set with it when created |
void |
setLocation(org.eclipse.swt.graphics.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(org.eclipse.swt.widgets.Composite owner)
Shows the dialog. |
void |
showDialog(org.eclipse.swt.widgets.Composite callBackParent,
java.lang.String callBackMethod)
Shows the dialog. |
int |
showDialog(org.eclipse.swt.widgets.Composite owner,
java.lang.String title,
org.eclipse.swt.graphics.Point location)
Shows the dialog. |
void |
showModalWindow()
Shows the dialog as a modal window |
static java.awt.Font |
SWTtoAWT(org.eclipse.swt.graphics.Font f)
Get the AWT font conversion |
boolean |
wasMouseClicked()
A utility method used to determine if the last event corrseponds to a mouse click. |
| Methods inherited from class org.eclipse.swt.widgets.Composite |
|---|
changed, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList |
| Methods inherited from class org.eclipse.swt.widgets.Scrollable |
|---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
| Methods inherited from class org.eclipse.swt.widgets.Control |
|---|
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setLayoutData, setLocation, setMenu, setParent, setRedraw, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
| Methods inherited from class org.eclipse.swt.widgets.Widget |
|---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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 WIDTH_BORDER_CENTER
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 org.eclipse.swt.widgets.Composite focusComponent
protected int closeButtonID
protected org.eclipse.swt.widgets.Shell shell
| Constructor Detail |
|---|
public XDialog()
public XDialog(boolean modal,
int pad)
modal - true for a modal dialogpad - the amount of padding in pixels| Method Detail |
|---|
protected void checkSubclass()
checkSubclass in class XSwtPageprotected void init()
public void setBackground(org.eclipse.swt.graphics.Color c)
setBackground in class org.eclipse.swt.widgets.Controlc - the background colorpublic void setForeground(org.eclipse.swt.graphics.Color c)
setForeground in class org.eclipse.swt.widgets.Controlc - the foreground colorpublic void setFont(org.eclipse.swt.graphics.Font f)
setFont in class org.eclipse.swt.widgets.Controlf - the fontpublic static java.awt.Font SWTtoAWT(org.eclipse.swt.graphics.Font f)
f - SWT Font
public static int getLastReturnValue()
public java.lang.Object getContentPane()
getContentPane in interface XContentPanepublic void pageCreated()
pageCreated in interface PageSupportpageCreated in class XSwtPagepublic void pack()
pack in class org.eclipse.swt.widgets.Controlpublic void setCaption(java.lang.String c)
c - the new caption of dialog titlepublic java.awt.Dimension getMinimumSize()
public java.awt.Dimension getPreferredSize()
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 dialogsetUseNativeHeaderspublic void cancelDlg()
public void closeDlg()
public int showDialog(org.eclipse.swt.widgets.Composite owner,
java.lang.String title,
org.eclipse.swt.graphics.Point location)
owner - The container to which the dialog is added.title - The dialog title/captionlocation - The location on screen to show the dialog
public void showDialog(org.eclipse.swt.widgets.Composite 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(org.eclipse.swt.widgets.Composite owner)
owner - The container to which the dialog is added.
public void setSize(int width,
int height)
setSize in interface PageSupportsetSize in class org.eclipse.swt.widgets.Controlwidth - The new widthheight - The new heightpublic void setLocation(org.eclipse.swt.graphics.Point location)
setLocation in class org.eclipse.swt.widgets.Controllocation - the point on screen at which the dialog is to be shown.protected java.lang.Object getFocusComponent(java.lang.Object cont)
cont - the container to be checked for focus.
public java.lang.Object getReturnObject()
public boolean wasMouseClicked()
wasMouseClicked in interface PageSupportwasMouseClicked in class XSwtPagepublic void showModalWindow()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||