org.xwiki.gwt.user.client.ui
Class DialogBox

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Panel
              extended by com.google.gwt.user.client.ui.SimplePanel
                  extended by com.google.gwt.user.client.ui.PopupPanel
                      extended by org.xwiki.gwt.user.client.ui.DialogBox
All Implemented Interfaces:
com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>, com.google.gwt.event.shared.EventHandler, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.EventPreview, com.google.gwt.user.client.ui.AcceptsOneWidget, com.google.gwt.user.client.ui.HasAnimation, com.google.gwt.user.client.ui.HasOneWidget, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, com.google.gwt.user.client.ui.SourcesPopupEvents, Iterable<com.google.gwt.user.client.ui.Widget>, DragListener

public class DialogBox
extends com.google.gwt.user.client.ui.PopupPanel
implements DragListener, com.google.gwt.event.dom.client.ClickHandler

Generic dialog box with optimized dragging.

Version:
$Id: 4bafe2925f6b2873294d62ff150c6a0df7d3f7ec $

Nested Class Summary
 
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
static String DRAGGING_STYLE
          The style name used when the dialog is dragged.
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
DialogBox()
          Creates a new dialog that doesn't auto hide and is not modal.
DialogBox(boolean autoHide)
          Creates a new dialog that is not modal.
DialogBox(boolean autoHide, boolean modal)
          Creates a new dialog.
 
Method Summary
 String getCaption()
           
 com.google.gwt.user.client.ui.Image getIcon()
           
 com.google.gwt.user.client.ui.Widget getWidget()
           
 void onClick(com.google.gwt.event.dom.client.ClickEvent event)
           
 void onDrag(com.google.gwt.user.client.ui.Widget sender, int x, int y)
          This event is fired at the source of the drag, that is, the element where DragStart was fired, during the drag operation.
 void onDragEnd(com.google.gwt.user.client.ui.Widget sender, int x, int y)
          The source of the drag will receive a DragEnd event when the drag operation is complete, whether it was successful or not.
 void onDragStart(com.google.gwt.user.client.ui.Widget sender, int x, int y)
          Fired on an element when a drag is started.
protected  void onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event)
           
 void setCaption(String caption)
          Sets the text of the caption bar.
 void setIcon(com.google.gwt.user.client.ui.Image icon)
          Sets the icon on left of the caption bar.
 void setWidget(com.google.gwt.user.client.ui.Widget widget)
           
 
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addCloseHandler, addPopupListener, center, getContainerElement, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, hide, hide, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setHeight, setModal, setPopupPosition, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setVisible, setWidth, show, showRelativeTo
 
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, iterator, remove, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, 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, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, 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.shared.HasHandlers
fireEvent
 

Field Detail

DRAGGING_STYLE

public static final String DRAGGING_STYLE
The style name used when the dialog is dragged.

See Also:
Constant Field Values
Constructor Detail

DialogBox

public DialogBox()
Creates a new dialog that doesn't auto hide and is not modal.


DialogBox

public DialogBox(boolean autoHide)
Creates a new dialog that is not modal.

Parameters:
autoHide - Whether or not the dialog should auto hide when the user clicks outside of it.

DialogBox

public DialogBox(boolean autoHide,
                 boolean modal)
Creates a new dialog.

Parameters:
autoHide - Whether or not the dialog should auto hide when the user clicks outside of it.
modal - Specifies if the dialog box can loose focus.
Method Detail

getCaption

public String getCaption()
Returns:
the text of the caption bar

setCaption

public void setCaption(String caption)
Sets the text of the caption bar.

Parameters:
caption - the string to be placed on the caption bar

getIcon

public com.google.gwt.user.client.ui.Image getIcon()
Returns:
the image on the left of the caption bar

setIcon

public void setIcon(com.google.gwt.user.client.ui.Image icon)
Sets the icon on left of the caption bar.

Parameters:
icon - the image to placed on the left of the caption bar

getWidget

public com.google.gwt.user.client.ui.Widget getWidget()
Specified by:
getWidget in interface com.google.gwt.user.client.ui.HasOneWidget
Overrides:
getWidget in class com.google.gwt.user.client.ui.SimplePanel

setWidget

public void setWidget(com.google.gwt.user.client.ui.Widget widget)
Specified by:
setWidget in interface com.google.gwt.user.client.ui.HasOneWidget
Overrides:
setWidget in class com.google.gwt.user.client.ui.PopupPanel

onPreviewNativeEvent

protected void onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event)
Overrides:
onPreviewNativeEvent in class com.google.gwt.user.client.ui.PopupPanel

onDragStart

public void onDragStart(com.google.gwt.user.client.ui.Widget sender,
                        int x,
                        int y)
Description copied from interface: DragListener
Fired on an element when a drag is started. The user is requesting to drag the element the DragStart event is fired at (the sender of the notification). During this event, a listener would set information such the drag data and image to be associated with the drag.

Specified by:
onDragStart in interface DragListener
Parameters:
sender - The object the user is requesting to drag.
x - the horizontal coordinate of the mouse when the event was fired.
y - the vertical coordinate of the mouse when the event was fired.

onDrag

public void onDrag(com.google.gwt.user.client.ui.Widget sender,
                   int x,
                   int y)
Description copied from interface: DragListener
This event is fired at the source of the drag, that is, the element where DragStart was fired, during the drag operation.

Specified by:
onDrag in interface DragListener
Parameters:
sender - The object being dragged.
x - the horizontal coordinate of the mouse when the event was fired.
y - the vertical coordinate of the mouse when the event was fired.

onDragEnd

public void onDragEnd(com.google.gwt.user.client.ui.Widget sender,
                      int x,
                      int y)
Description copied from interface: DragListener
The source of the drag will receive a DragEnd event when the drag operation is complete, whether it was successful or not.

Specified by:
onDragEnd in interface DragListener
Parameters:
sender - The object the the user has stopped dragging.
x - the horizontal coordinate of the mouse when the event was fired.
y - the vertical coordinate of the mouse when the event was fired.

onClick

public void onClick(com.google.gwt.event.dom.client.ClickEvent event)
Specified by:
onClick in interface com.google.gwt.event.dom.client.ClickHandler


Copyright © 2004–2014 XWiki. All rights reserved.