|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.SimplePanel
com.google.gwt.user.client.ui.PopupPanel
com.google.gwt.user.client.ui.DecoratedPopupPanel
com.sage.swt.client.widget.ClosableDialogBox
com.sage.swt.client.widget.SwtDialogBox
public class SwtDialogBox
SwtDialogBox is a customized dialog box for SWT. It extends the
ClosableDialogBox
by adding the ability to have a "close" button
(looks like "x"), "help" button (looks like "?") , and "applicationMenu" menu
(looks like menu drop-down) in the title bar.
Nested Class Summary | |
---|---|
static class |
SwtDialogBox.DialogResult
List of possible results of how the dialog got closed. |
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel |
---|
com.google.gwt.user.client.ui.PopupPanel.PositionCallback |
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets |
---|
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget |
Field Summary |
---|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
SwtDialogBox()
Creates a modal SWT dialog box that shows the "close" image (an "X" at the top corner of the dialog box) and that does not auto-hide when the mouse is clicked outside of it. |
|
SwtDialogBox(boolean showCloseImage)
Creates a modal SWT dialog box that does not auto-hide when the mouse is clicked outside of it and that specifies whether or not to show the "close" image (an "X" at the top corner of the dialog box). |
|
SwtDialogBox(boolean autoHide,
boolean showCloseImage)
Creates a modal SWT dialog box that specifies whether or not to auto-hide the dialog box when the mouse is clicked outside of it and whether or not to show the "close" image (an "X" at the top corner of the dialog box). |
|
SwtDialogBox(boolean autoHide,
boolean showCloseImage,
boolean showHelpButton)
Creates a modal SWT dialog box. |
|
SwtDialogBox(boolean autoHide,
boolean showCloseImage,
boolean showHelpButton,
boolean modal)
Creates a modal SWT dialog box. |
|
SwtDialogBox(WidgetKey widgetKey,
SwtErrorStack errorStack,
boolean autoHide,
boolean showCloseImage,
boolean showHelpButton,
boolean showMenuButton,
boolean modal,
java.lang.String portletCommunicationID)
Creates a modal SWT dialog box. |
Method Summary | |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addBeforePopupClosedHandler(BeforePopupClosedHandler handler)
Adds a BeforePopupClosedEvent handler |
com.google.gwt.event.shared.HandlerRegistration |
addHelpbuttonClickedHandler(com.google.gwt.event.dom.client.ClickHandler handler)
Add a handler for the help button |
com.google.gwt.event.shared.HandlerRegistration |
addMenuButtonClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
Adds a handler interface to the menu button to receive click events. |
SwtDialogBox.DialogResult |
getDialogResult()
Gets the dialog box's result code (which indicates whether or not the dialog was closed with the intention of cancelling it). |
java.lang.String |
getPortletCommunicationID()
|
void |
hide()
|
void |
hide(boolean autoClosed)
This override fires a BeforePopupClosed event that lets us cancel the closing (hiding) of the dialog box if one of those "before" handlers indicates that we should cancel that closing. |
void |
setApplicationMenuHelp(java.lang.String helpID)
Sets the application menu Help ID so that a menu item can be created |
void |
setApplicationMenuXML(java.lang.String menuXML)
Sets the application menu XML so that menu items can be created |
void |
setCloseButtonVisible(boolean show)
Sets whether or not to show the close image (an "X" at the top corner of the dialog box). |
void |
setInstanceContext(InstanceContext context)
Sets the instance context where this widget resides. |
void |
setMenuButtonVisible(boolean visible)
Sets the visibility of the Menu Button. |
void |
show()
This override ensures that the "close" image (an "X" at the top corner of the dialog box) is always shown in the correct state. |
void |
showCentered()
Displays the DialogBox in the center of the screen. |
Methods inherited from class com.sage.swt.client.widget.ClosableDialogBox |
---|
center, getHTML, getPanel, getText, getWidget, onEnsureDebugId, onEventPreview, onMouseDown, onMouseMove, onMouseUp, remove, setCaptionHTML, setCaptionText, setHTML, setText, setWidget |
Methods inherited from class com.google.gwt.user.client.ui.DecoratedPopupPanel |
---|
clear, doAttachChildren, doDetachChildren, getCellElement, iterator |
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel |
---|
addAutoHidePartner, addCloseHandler, addPopupListener, getContainerElement, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onPreviewNativeEvent, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setHeight, setModal, setPopupPosition, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setVisible, setWidth, showRelativeTo |
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel |
---|
add, setWidget |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
---|
add, adopt, adopt, disown, orphan, remove |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, removeStyleName, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.event.logical.shared.HasCloseHandlers |
---|
addCloseHandler |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public SwtDialogBox()
public SwtDialogBox(boolean showCloseImage)
showCloseImage
- Indicates whether or not to show the "close" image (an "X" at
the top corner of the dialog box).public SwtDialogBox(boolean autoHide, boolean showCloseImage)
autoHide
- Whether or not to auto-hide the dialog box when the mouse is
clicked outside of it.showCloseImage
- Indicates whether or not to show the "close" image (an "X" at
the top corner of the dialog box).public SwtDialogBox(boolean autoHide, boolean showCloseImage, boolean showHelpButton)
autoHide
- Whether or not to auto-hide the dialog box when the mouse is
clicked outside of it.showCloseImage
- Indicates whether or not to show the "close" image (an "X" at
the top corner of the dialog box).showHelpButton
- Indicates whether or not to show the help image (an "?" at the
top corner of the dialog box).public SwtDialogBox(boolean autoHide, boolean showCloseImage, boolean showHelpButton, boolean modal)
autoHide
- Whether or not to auto-hide the dialog box when the mouse is
clicked outside of it.showCloseImage
- Indicates whether or not to show the "close" image (an "X" at
the top corner of the dialog box).showHelpButton
- Indicates whether or not to show the help image (an "?" at the
top corner of the dialog box).modal
- true
if keyboard and mouse events for widgets not
contained by the dialog should be ignoredpublic SwtDialogBox(WidgetKey widgetKey, SwtErrorStack errorStack, boolean autoHide, boolean showCloseImage, boolean showHelpButton, boolean showMenuButton, boolean modal, java.lang.String portletCommunicationID)
widgetKey
- The WidgetKey
for the widget.errorStack
- The SwtErrorStack
that stores
the list of UI errors.autoHide
- Whether or not to auto-hide the dialog box when the mouse is
clicked outside of it.showCloseImage
- Indicates whether or not to show the "close" image (an "X" at
the top corner of the dialog box).showHelpButton
- Indicates whether or not to show the help image (an "?" at the
top corner of the dialog box).showMenuButton
- Indicates whether or not to show the menu button (at the top
corner of the dialog box).modal
- true
if keyboard and mouse events for widgets not
contained by the dialog should be ignoredportletCommunicationID
- The portlet communication IDMethod Detail |
---|
public java.lang.String getPortletCommunicationID()
public void setApplicationMenuHelp(java.lang.String helpID)
helpID
- The helpID for the application menupublic void setApplicationMenuXML(java.lang.String menuXML)
menuXML
- The XML for the application menupublic void setMenuButtonVisible(boolean visible)
visible
- Whether or not this widget should be is visible.public com.google.gwt.event.shared.HandlerRegistration addHelpbuttonClickedHandler(com.google.gwt.event.dom.client.ClickHandler handler)
handler
- the handler which handles the click event from the help button
HandlerRegistration
public com.google.gwt.event.shared.HandlerRegistration addMenuButtonClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
handler
- The handler interface to add.
HandlerRegistration
used to remove this handler.public com.google.gwt.event.shared.HandlerRegistration addBeforePopupClosedHandler(BeforePopupClosedHandler handler)
BeforePopupClosedEvent
handler
addBeforePopupClosedHandler
in interface HasBeforePopupClosedHandlers
handler
- the handler
public void show()
show
in class ClosableDialogBox
public void showCentered()
Displays the DialogBox in the center of the screen.
Found this code in the GWT discussion group: http://groups.google.com/group /Google-Web-Toolkit/browse_thread/thread/9e113d a433ccf79a/b79facc1159b482a#b79facc1159b482a
public void hide()
hide
in class ClosableDialogBox
public void hide(boolean autoClosed)
hide
in class ClosableDialogBox
autoClosed
- Whether or not the attempt to hide the dialog box was
automatically triggered (by clicking outside the dialog when it
has auto-hide behavior).public SwtDialogBox.DialogResult getDialogResult()
Gets the dialog box's result code (which indicates whether or not the dialog was closed with the intention of cancelling it).
This result code is only meaningful at the time when
PopupListener.onPopupClosed
happens. It is not meaningful while the
dialog is shown (from the "show"-type method call until that
onPopupClosed
). Specifically, it is not meaningful during
public void setCloseButtonVisible(boolean show)
show
- Whether or not to show the close image (an "X" at the top corner
of the dialog box).public void setInstanceContext(InstanceContext context)
context
- The instance context where the widget will reside.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |