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.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.HasAnimation, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.SourcesPopupEvents, java.lang.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: DialogBox.java 24900 2009-11-06 16:53:01Z sdumitriu $

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
 
Field Summary
static java.lang.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
 java.lang.String getCaption()
           
 com.google.gwt.user.client.ui.Image getIcon()
           
 com.google.gwt.user.client.ui.Widget getWidget()
          
 void hide()
          
 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(java.lang.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)
          
 void show()
          
 
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addCloseHandler, addPopupListener, center, getContainerElement, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, hide, isAnimationEnabled, isAutoHideEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAutoHideEnabled, setHeight, setModal, setPopupPosition, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setVisible, setWidth, showRelativeTo
 
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, iterator, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, onLoad, orphan
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, fireEvent, getHandlerCount, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, 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, setElement, setElement, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, 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 java.lang.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 java.lang.String getCaption()
Returns:
the text of the caption bar

setCaption

public void setCaption(java.lang.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()

Overrides:
getWidget in class com.google.gwt.user.client.ui.SimplePanel
See Also:
SimplePanel.getWidget()

setWidget

public void setWidget(com.google.gwt.user.client.ui.Widget widget)

Overrides:
setWidget in class com.google.gwt.user.client.ui.PopupPanel
See Also:
PopupPanel.setWidget(Widget)

onPreviewNativeEvent

protected void onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event)

Overrides:
onPreviewNativeEvent in class com.google.gwt.user.client.ui.PopupPanel
See Also:
PopupPanel#onPreviewNativeEvent(NativePreviewEvent)

onDragStart

public void onDragStart(com.google.gwt.user.client.ui.Widget sender,
                        int x,
                        int y)
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.
See Also:
DragListener.onDragStart(Widget, int, int)

onDrag

public 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.

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.
See Also:
DragListener.onDrag(Widget, int, int)

onDragEnd

public 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.

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.
See Also:
DragListener.onDragEnd(Widget, int, int)

show

public void show()

Overrides:
show in class com.google.gwt.user.client.ui.PopupPanel
See Also:
PopupPanel.show()

hide

public void hide()

Overrides:
hide in class com.google.gwt.user.client.ui.PopupPanel
See Also:
PopupPanel.hide()

onClick

public void onClick(com.google.gwt.event.dom.client.ClickEvent event)

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


Copyright © 2004-2009 XWiki. All Rights Reserved.