public class Modal extends Div implements IsClosable
<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>
ModalHeader,
ModalBody,
ModalFooter,
ModalShowEvent,
ModalShownEvent,
ModalHideEvent,
ModalHiddenEventUIObject.DebugIdImpl, UIObject.DebugIdImplEnabledIndexedPanel.ForIsWidgetHasWidgets.ForIsWidgetDEBUG_ID_PREFIX| Constructor and Description |
|---|
Modal() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected void |
onUnload() |
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() |
getId, getPull, insert, insert, remove, setColor, setHiddenOn, setId, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPull, setVisibleOnadd, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, iterator, removeadd, adopt, clear, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic Modal()
public void add(Widget w)
ComplexWidgetadd in interface HasWidgetsadd in class ComplexWidgetpublic void setClosable(boolean closable)
setClosable in interface IsClosablepublic boolean isClosable()
isClosable in interface IsClosablepublic void setHideOtherModals(boolean hideOtherModals)
hideOtherModals - - true to force hide other modals, false to keep them shownpublic void setRemoveOnHide(boolean removeOnHide)
removeOnHide - - true to remove modal and unbind events on hide, false to keep it in the DOMpublic void setFade(boolean fade)
fade - If true modal will fade in/outpublic void setDataBackdrop(ModalBackdrop backdrop)
backdrop - Backdrop of modalModalBackdroppublic void setDataKeyboard(boolean keyboard)
public void toggle()
public void show()
public void hide()
public HandlerRegistration addShowHandler(ModalShowHandler modalShowHandler)
public HandlerRegistration addShownHandler(ModalShownHandler modalShownHandler)
public HandlerRegistration addHideHandler(ModalHideHandler modalHideHandler)
public HandlerRegistration addHiddenHandler(ModalHiddenHandler modalHiddenHandler)
protected void onShow(Event evt)
evt - EventModalShowEventprotected void onShown(Event evt)
evt - EventModalShownEventprotected void onHide(Event evt)
evt - EventModalHideEventprotected void onHidden(Event evt)
evt - EventModalHiddenEventCopyright © 2017. All rights reserved.