org.gwtbootstrap3.client.ui
Class Modal

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.ComplexPanel
                  extended by org.gwtbootstrap3.client.ui.base.ComplexWidget
                      extended by org.gwtbootstrap3.client.ui.html.Div
                          extended by org.gwtbootstrap3.client.ui.Modal
All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, Iterable<Widget>, HasId, HasInlineStyle, HasPull, HasResponsiveness, IsClosable

public class Modal
extends Div
implements IsClosable

Modal dialog.

UiBinder example

 <b:Modal title="Important information" b:id="modal1">
         <b:ModalBody>
             <g:HTML>Lorem ipsum...</g:HTML>
         </b:ModalBody>
         <b:ModalFooter>
             <b:Button type="PRIMARY">Do something</b:Button>
             <b:Button type="DANGER" dismiss="MODAL">Close</b:Button>
         </b:ModalFooter>
     </b:Modal>
     <b:Button target="#modal1" toggle="MODAL">Show modal</b:Button>
 
 

It's also possible to specify a custom modal header:

 <b:Modal>
         <b:ModalHeader>
             <g:HTML>
                 <h4>Custom header</h4>
             </g:HTML>
         </b:ModalHeader>
         ...
     </b:Modal>
 
 

Author:
Sven Jacobs, Joshua Godi
See Also:
ModalHeader, ModalBody, ModalFooter, ModalShowEvent, ModalShownEvent, ModalHideEvent, ModalHiddenEvent

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
IndexedPanel.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
Modal()
           
 
Method Summary
 void add(Widget w)
          
 HandlerRegistration addHiddenHandler(ModalHiddenHandler modalHiddenHandler)
           
 HandlerRegistration addHideHandler(ModalHideHandler modalHideHandler)
           
 HandlerRegistration addShowHandler(ModalShowHandler modalShowHandler)
           
 HandlerRegistration addShownHandler(ModalShownHandler modalShownHandler)
           
 void hide()
           
 boolean isClosable()
           
protected  void onHidden(Event evt)
          Can be override by subclasses to handle Modal's "hidden" event however it's recommended to add an event handler to the modal.
protected  void onHide(Event evt)
          Can be override by subclasses to handle Modal's "hide" event however it's recommended to add an event handler to the modal.
protected  void onLoad()
           
protected  void onShow(Event evt)
          Can be override by subclasses to handle Modal's "show" event however it's recommended to add an event handler to the modal.
protected  void onShown(Event evt)
          Can be override by subclasses to handle Modal's "shown" event however it's recommended to add an event handler to the modal.
 void setClosable(boolean closable)
           
 void setDataBackdrop(ModalBackdrop backdrop)
          Sets backdrop of modal.
 void setDataKeyboard(boolean keyboard)
           
 void setFade(boolean fade)
          If set Modal will fade in/out.
 void setHideOtherModals(boolean hideOtherModals)
          If set to true, when the modal is shown it will force hide all other modals
 void setRemoveOnHide(boolean removeOnHide)
          If set to true, will remove the modal from the DOM completely and unbind any events to the modal
 void setSize(ModalSize size)
           
 void setTitle(String title)
           
 void setWidth(String width)
           
 void show()
           
 void toggle()
           
 
Methods inherited from class org.gwtbootstrap3.client.ui.base.ComplexWidget
getId, getPull, insert, setColor, setHiddenOn, setId, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPull, setVisibleOn
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, 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, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, setVisible, sinkBitlessEvent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Modal

public Modal()
Method Detail

setWidth

public void setWidth(String width)
Overrides:
setWidth in class UIObject

setSize

public void setSize(ModalSize size)

onLoad

protected void onLoad()
Overrides:
onLoad in class Widget

add

public void add(Widget w)
Description copied from class: ComplexWidget

Specified by:
add in interface HasWidgets
Overrides:
add in class ComplexWidget

setTitle

public void setTitle(String title)
Overrides:
setTitle in class UIObject

setClosable

public void setClosable(boolean closable)
Specified by:
setClosable in interface IsClosable

isClosable

public boolean isClosable()
Specified by:
isClosable in interface IsClosable

setHideOtherModals

public void setHideOtherModals(boolean hideOtherModals)
If set to true, when the modal is shown it will force hide all other modals

Parameters:
hideOtherModals - - true to force hide other modals, false to keep them shown

setRemoveOnHide

public void setRemoveOnHide(boolean removeOnHide)
If set to true, will remove the modal from the DOM completely and unbind any events to the modal

Parameters:
removeOnHide - - true to remove modal and unbind events on hide, false to keep it in the DOM

setFade

public void setFade(boolean fade)
If set Modal will fade in/out.

Parameters:
fade - If true modal will fade in/out

setDataBackdrop

public void setDataBackdrop(ModalBackdrop backdrop)
Sets backdrop of modal.

Parameters:
backdrop - Backdrop of modal
See Also:
ModalBackdrop

setDataKeyboard

public void setDataKeyboard(boolean keyboard)

toggle

public void toggle()

show

public void show()

hide

public void hide()

addShowHandler

public HandlerRegistration addShowHandler(ModalShowHandler modalShowHandler)

addShownHandler

public HandlerRegistration addShownHandler(ModalShownHandler modalShownHandler)

addHideHandler

public HandlerRegistration addHideHandler(ModalHideHandler modalHideHandler)

addHiddenHandler

public HandlerRegistration addHiddenHandler(ModalHiddenHandler modalHiddenHandler)

onShow

protected void onShow(Event evt)
Can be override by subclasses to handle Modal's "show" event however it's recommended to add an event handler to the modal.

Parameters:
evt - Event
See Also:
ModalShowEvent

onShown

protected void onShown(Event evt)
Can be override by subclasses to handle Modal's "shown" event however it's recommended to add an event handler to the modal.

Parameters:
evt - Event
See Also:
ModalShownEvent

onHide

protected void onHide(Event evt)
Can be override by subclasses to handle Modal's "hide" event however it's recommended to add an event handler to the modal.

Parameters:
evt - Event
See Also:
ModalHideEvent

onHidden

protected void onHidden(Event evt)
Can be override by subclasses to handle Modal's "hidden" event however it's recommended to add an event handler to the modal.

Parameters:
evt - Event
See Also:
ModalHiddenEvent


Copyright © 2015. All rights reserved.