public class MaterialModal extends MaterialWidget implements HasType<ModalType>, HasInOutDurationTransition, HasDismissible, com.google.gwt.event.logical.shared.HasCloseHandlers<MaterialModal>, com.google.gwt.event.logical.shared.HasOpenHandlers<MaterialModal>, HasFullscreen
<m:MaterialModal ui:field="modal" type="FIXED_FOOTER" dismissible="true" inDuration="500" outDuration="800">
<m:MaterialModalContent>
<m:MaterialTitle title="Title" description="Description" />
</m:MaterialModalContent>
<m:MaterialModalFooter>
<m:MaterialButton text="Close Modal" type="FLAT"/>
</m:MaterialModalFooter>
</m:MaterialModal>
*
{ @code @UiField MaterialModal modal; modal.open(); }
MaterialWidget.Feature
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
$this
Constructor and Description |
---|
MaterialModal() |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<MaterialModal> handler) |
com.google.gwt.event.shared.HandlerRegistration |
addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<MaterialModal> handler) |
void |
close()
Close the modal programmatically.
|
void |
close(boolean autoClosed)
Close the modal programmatically.
|
void |
close(boolean autoClosed,
boolean fireEvent)
Close the modal programmatically.
|
protected void |
close(com.google.gwt.dom.client.Element e,
boolean autoClosed,
boolean fireEvent) |
protected FullscreenMixin |
getFullscreenMixin() |
int |
getInDuration()
Get the in / enter animation duration in milliseconds.
|
double |
getOpacity() |
int |
getOutDuration()
Get the out / exit animation duration in milliseconds.
|
ModalType |
getType()
Gets the type of the widget.
|
protected CssTypeMixin<ModalType,MaterialModal> |
getTypeMixin() |
boolean |
isDismissible() |
boolean |
isFullscreen() |
protected void |
onNativeClose(boolean autoClosed,
boolean fireEvent) |
protected void |
onNativeOpen(boolean fireEvent) |
void |
open()
Open the modal programmatically
|
void |
open(boolean fireEvent)
Open the modal programmatically
|
protected void |
open(com.google.gwt.dom.client.Element e,
boolean fireEvent)
Open modal with additional properties
|
void |
setDismissible(boolean dismissible)
Set dismissible when swiping left / right.
|
void |
setEnabled(boolean enabled) |
void |
setFullscreen(boolean value) |
void |
setInDuration(int inDuration)
Set the in / enter animation duration in milliseconds.
|
void |
setOpacity(double opacity) |
void |
setOutDuration(int outDuration)
Set the out / exit animation duration in milliseconds.
|
void |
setType(ModalType type)
Sets the type on the widget
|
$this, add, add, addAttachHandler, addBlurHandler, addClickHandler, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragLeaveHandler, addDragMoveHandler, addDragOverHandler, addDragStartHandler, addDropActivateHandler, addDropDeactivateHandler, addDropHandler, addFocusHandler, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addOrientationChangeHandler, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, body, clearActiveClass, enableFeature, getBackfaceVisibility, getBackgroundColor, getBorder, getBorderBottom, getBorderLeft, getBorderMixin, getBorderRadius, getBorderRight, getBorderTop, getCenterOn, getCenterOnMixin, getChildren, getChildrenList, getCircleMixin, getColorsMixin, getDataAttribute, getDepth, getDimensionMixin, getEnabledMixin, getFlexboxMixin, getFloat, getFloatMixin, getFocusableMixin, getFontSize, getFontSizeMixin, getFontWeight, getFontWeightMixin, getGridMixin, getHandlerRegistry, getHideOn, getHideOnMixin, getHoverableMixin, getId, getIdMixin, getInitialClasses, getLayoutPosition, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOrientation, getOrientationMixin, getPerspective, getPerspectiveOrigin, getScrollspy, getScrollspyMixin, getSeparatorMixin, getShadow, getShadowMixin, getShowOn, getShowOnMixin, getTabIndex, getTextAlign, getTextAlignMixin, getTextColor, getTooltip, getTooltipDelayMs, getTooltipHTML, getTooltipMixin, getTooltipPosition, getTransform, getTransformMixin, getTransformOrigin, getTransformStyle, getTruncateMixin, getVerticalAlign, getVerticalAlignMixin, getWaves, getWavesMixin, getWidth, insert, insert, isCircle, isDetectOrientation, isEnabled, isFeatureEnabled, isHoverable, isSeparator, isTruncate, onLoad, onUnload, registerHandler, removeHandler, setAccessKey, setBackfaceVisibility, setBackgroundColor, setBorder, setBorderBottom, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBottom, setCenterOn, setCircle, setClass, setDataAttribute, setDepth, setDetectOrientation, setDisplay, setFlex, setFlexAlignContent, setFlexAlignItems, setFlexAlignSelf, setFlexBasis, setFlexDirection, setFlexGrow, setFlexJustifyContent, setFlexOrder, setFlexShrink, setFlexWrap, setFloat, setFocus, setFontSize, setFontSize, setFontWeight, setGrid, setGwtDisplay, setHideOn, setHoverable, setId, setInitialClasses, setLayoutPosition, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOffset, setOrientation, setOverflow, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPerspective, setPerspectiveOrigin, setRight, setScrollspy, setSeparator, setShadow, setShowOn, setStyle, setTabIndex, setTextAlign, setTextColor, setTooltip, setTooltipDelayMs, setTooltipHTML, setTooltipPosition, setTop, setTransform, setTransformOrigin, setTransformStyle, setTransition, setTruncate, setVerticalAlign, setVisibility, setWaves, stopTouchStartEvent, validate, window
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, iterator, remove, remove
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
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, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setVisible
forEach, spliterator
public MaterialModal()
public void setType(ModalType type)
HasType
public ModalType getType()
HasType
public void setInDuration(int inDuration)
HasInOutDurationTransition
setInDuration
in interface HasInOutDurationTransition
public int getInDuration()
HasInOutDurationTransition
getInDuration
in interface HasInOutDurationTransition
public void setOutDuration(int outDuration)
HasInOutDurationTransition
setOutDuration
in interface HasInOutDurationTransition
public int getOutDuration()
HasInOutDurationTransition
getOutDuration
in interface HasInOutDurationTransition
public void setDismissible(boolean dismissible)
HasDismissible
setDismissible
in interface HasDismissible
public boolean isDismissible()
isDismissible
in interface HasDismissible
public void setOpacity(double opacity)
setOpacity
in interface HasOpacity
setOpacity
in class MaterialWidget
public double getOpacity()
getOpacity
in interface HasOpacity
getOpacity
in class MaterialWidget
public void setEnabled(boolean enabled)
setEnabled
in interface com.google.gwt.user.client.ui.HasEnabled
setEnabled
in class MaterialWidget
public void setFullscreen(boolean value)
setFullscreen
in interface HasFullscreen
public boolean isFullscreen()
isFullscreen
in interface HasFullscreen
public void open()
Note: the MaterialModal component must be added to the document before calling this method. When declaring this modal on a UiBinder file, the MaterialModal is already added, but if you call it using pure Java, you must add it to a container before opening the modal. You can do it by calling, for example:
MaterialModal modal = new MaterialModal(); RootPanel.get().add(modal);
IllegalStateException
- If the MaterialModal is not added to the documentpublic void open(boolean fireEvent)
Note: the MaterialModal component must be added to the document before calling this method. When declaring this modal on a UiBinder file, the MaterialModal is already added, but if you call it using pure Java, you must add it to a container before opening the modal. You can do it by calling, for example:
MaterialModal modal = new MaterialModal(); RootPanel.get().add(modal);
fireEvent
- - Flag whether this component fires Open EventIllegalStateException
- If the MaterialModal is not added to the documentprotected void open(com.google.gwt.dom.client.Element e, boolean fireEvent)
e
- - Modal ComponentfireEvent
- - Flag whether this component fires Open Eventprotected void onNativeOpen(boolean fireEvent)
protected void onNativeClose(boolean autoClosed, boolean fireEvent)
public void close()
close(boolean)
with false
as parameter.
Note: you may need to remove it MaterialModal from the document if you
are not using UiBinder. See open()
.
public void close(boolean autoClosed)
Note: you may need to remove it MaterialModal from the document if you
are not using UiBinder. See open()
.
autoClosed
- Flag indicating if the modal was automatically dismissedCloseEvent
public void close(boolean autoClosed, boolean fireEvent)
Note: you may need to remove it MaterialModal from the document if you
are not using UiBinder. See open()
.
autoClosed
- Flag indicating if the modal was automatically dismissedfireEvent
- Flag whether this component fires Close EventCloseEvent
protected void close(com.google.gwt.dom.client.Element e, boolean autoClosed, boolean fireEvent)
public com.google.gwt.event.shared.HandlerRegistration addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<MaterialModal> handler)
addCloseHandler
in interface com.google.gwt.event.logical.shared.HasCloseHandlers<MaterialModal>
public com.google.gwt.event.shared.HandlerRegistration addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<MaterialModal> handler)
addOpenHandler
in interface com.google.gwt.event.logical.shared.HasOpenHandlers<MaterialModal>
protected CssTypeMixin<ModalType,MaterialModal> getTypeMixin()
protected FullscreenMixin getFullscreenMixin()
Copyright © 2018. All rights reserved.