public class Modal extends DivWidget implements HasVisibility, HasVisibleHandlers, IsAnimated
footer.
By default, all other Modals are closed once a new one is opened. This
setting can be overridden.
<b:Modal title="My Modal" backdrop="STATIC">
<g:Label>Modal Content!</g:Label>
<b:ModalFooter>
<b:Button icon="FILE">Save</b:Button>
</b:ModalFooter>
</b:Modal>
All arguments are optional.
PopupPanel
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
InsertPanel.ForIsWidget
HasWidgets.ForIsWidget
DEBUG_ID_PREFIX
Constructor and Description |
---|
Modal()
Creates an empty, hidden widget.
|
Modal(boolean animated)
Creates an empty, hidden widget with specified show behavior.
|
Modal(boolean animated,
boolean dynamicSafe)
Creates an empty, hidden widget with specified show behavior.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Widget w) |
HandlerRegistration |
addHiddenHandler(HiddenHandler handler)
Adds a
HiddenEvent handler. |
HandlerRegistration |
addHideHandler(HideHandler handler)
Adds a
HideEvent handler. |
HandlerRegistration |
addShowHandler(ShowHandler handler)
Adds a
ShowEvent handler. |
HandlerRegistration |
addShownHandler(ShownHandler handler)
Adds a
ShownEvent handler. |
boolean |
getAnimation()
Gets whether the widget is animated.
|
BackdropType |
getBackdropType()
Get backdrop type.
|
String |
getTitle()
Gets the title of the Modal.
|
void |
hide()
Hides the widget if it was previously shown.
|
void |
hide(boolean autoHidden) |
void |
insert(Widget w,
int beforeIndex) |
boolean |
isKeyboardEnable()
Get Keyboard enable state
|
protected void |
onAttach() |
protected void |
onHidden(Event e)
This method is called once the widget is completely hidden.
|
protected void |
onHide(Event e)
This method is called immediately when the widget's
hide()
method is executed. |
protected void |
onShow(Event e)
This method is called immediately when the widget's
show()
method is executed. |
protected void |
onShown(Event e)
This method is called once the widget is completely shown.
|
protected void |
reconfigure()
Reconfigures the modal with changed settings.
|
void |
setAnimation(boolean animated)
Sets whether the Widget should be animated.
|
void |
setBackdrop(BackdropType type)
Sets the type of the backdrop.
|
void |
setCloseVisible(boolean visible)
Show/Hide close button.
|
void |
setDynamicSafe(boolean dynamicSafe)
Setup the modal to prevent memory leaks.
|
void |
setHideOthers(boolean hideOthers)
Sets whether this Modal appears on top of others or is the only one
visible on screen.
|
void |
setKeyboard(boolean keyboard)
Sets whether the Modal is closed when the
ESC is pressed. |
void |
setMaxHeigth(String maxHeight)
Sets the Modal's body maxHeight.
|
void |
setSize(String width,
String height)
Deprecated.
modal do not support setSize method
|
void |
setTitle(String title)
Sets the title of the Modal.
|
void |
setWidth(int width)
Sets the Modal's width.
|
void |
show()
Shows the widget if it was previously hidden.
|
void |
show(boolean autoShow) |
void |
toggle()
Toggles the view state of the widget.
|
void |
toggle(boolean autoToggle) |
addStyle, getId, pullRight, removeStyle, setHideOn, setId, setPullRight, setShowOn, setStyle
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
add, adopt, adopt, disown, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add
getWidgetIndex
getWidget, getWidgetCount, getWidgetIndex, remove
public Modal()
public Modal(boolean animated)
animated
- true
if the widget should be animated.public Modal(boolean animated, boolean dynamicSafe)
animated
- true
if the widget should be animated.dynamicSafe
- true
removes from RootPanel when hiddenpublic void setDynamicSafe(boolean dynamicSafe)
Default is false.
dynamicSafe
- public void setAnimation(boolean animated)
setAnimation
in interface IsAnimated
animated
- true
if the widget should be animated.public boolean getAnimation()
getAnimation
in interface IsAnimated
true
if the widget is animatedpublic void setHideOthers(boolean hideOthers)
hideOthers
- true
to make sure that this modal is the only one
shown. All others will be hidden. Default: true
public void setKeyboard(boolean keyboard)
ESC
is pressed.keyboard
- true
if the Modal is closed by ESC
key. Default: true
public boolean isKeyboardEnable()
public void setBackdrop(BackdropType type)
type
- the backdrop typepublic BackdropType getBackdropType()
protected void reconfigure()
public void add(Widget w)
add
in interface HasWidgets
add
in interface InsertPanel
add
in class FlowPanel
public void insert(Widget w, int beforeIndex)
insert
in interface InsertPanel
insert
in class FlowPanel
public void show()
public void show(boolean autoShow)
public void hide()
public void hide(boolean autoHidden)
public void toggle()
It will be hidden if it was previously shown and shown if it was previously hidden.
public void toggle(boolean autoToggle)
protected void onHide(Event e)
hide()
method is executed.protected void onHidden(Event e)
protected void onShow(Event e)
show()
method is executed.public HandlerRegistration addHideHandler(HideHandler handler)
HideEvent
handler.addHideHandler
in interface HasVisibleHandlers
handler
- the hide handlerHandlerRegistration
used to remove this handlerpublic HandlerRegistration addHiddenHandler(HiddenHandler handler)
HiddenEvent
handler.addHiddenHandler
in interface HasVisibleHandlers
handler
- the hidden handlerHandlerRegistration
used to remove this handlerpublic HandlerRegistration addShowHandler(ShowHandler handler)
ShowEvent
handler.addShowHandler
in interface HasVisibleHandlers
handler
- the show handlerHandlerRegistration
used to remove this handlerpublic HandlerRegistration addShownHandler(ShownHandler handler)
ShownEvent
handler.addShownHandler
in interface HasVisibleHandlers
handler
- the shown handlerHandlerRegistration
used to remove this handlerpublic void setCloseVisible(boolean visible)
visible
- true for show and false to hide. Defaults is
true.public void setSize(String width, String height)
public void setWidth(int width)
width
- Modal's new width, in pxpublic void setMaxHeigth(String maxHeight)
maxHeight
- the Modal's body new maxHeight, in CSS units (e.g. "10px", "1em")Copyright © 2012-2014 gwtbootstrap. All Rights Reserved.