public class MaterialCutOut extends gwt.material.design.client.base.MaterialWidget implements com.google.gwt.event.logical.shared.HasCloseHandlers<MaterialCutOut>, com.google.gwt.event.logical.shared.HasOpenHandlers<MaterialCutOut>, gwt.material.design.client.base.HasCircle, gwt.material.design.client.base.HasDurationTransition
You can use CloseHandler
s to be notified when the cut out is closed.
xmlns:ma='urn:import:gwt.material.design.addins.client'
<ma:cutout.MaterialCutOut ui:field="cutOut">
<!-- add any widgets here -->
</ma:cutout.MaterialCutOut>
MaterialCutOut cutOut = ... //create using new or using UiBinder
cutOut.setTarget(myTargetWidget); //the widget or element you want to focus
cutOut.open(); //shows the modal over the page
material-cutout
class, and material-cutout-focus
class for the focusElement box.
setCircle(boolean)
is set to true
. This is because of problems on Safari
with box-shadows over rounded borders. To avoid this issue you can disable the circle. Check the
issue 227 for details.gwt.material.design.client.base.MaterialWidget.Feature
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
Constructor and Description |
---|
MaterialCutOut() |
MaterialCutOut(gwt.material.design.client.constants.Color backgroundColor,
Boolean circle,
Double opacity) |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<MaterialCutOut> handler) |
com.google.gwt.event.shared.HandlerRegistration |
addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<MaterialCutOut> handler) |
void |
close()
Closes the cut out.
|
void |
close(boolean autoClosed)
Closes the cut out.
|
String |
getAnimationTimingFunction() |
gwt.material.design.client.constants.Color |
getBackgroundColor() |
String |
getBackgroundSize() |
int |
getCutOutPadding() |
int |
getDuration() |
com.google.gwt.dom.client.Element |
getFocusElement() |
double |
getOpacity() |
com.google.gwt.dom.client.Element |
getTargetElement() |
boolean |
isAnimated() |
boolean |
isCircle() |
void |
open()
Opens the modal cut out taking all the screen.
|
void |
setAnimated(boolean animated)
Enables or disables the open animation of the cut out.
|
void |
setAnimationTimingFunction(String animationTimingFunction)
Sets the animation timing fucntion of the opening cut out.
|
void |
setBackgroundColor(gwt.material.design.client.constants.Color bgColor) |
void |
setBackgroundSize(String backgroundSize)
Sets the radius size of the Cut Out background.
|
void |
setCircle(boolean circle)
Sets if the cut out should be rendered as a circle or a simple rectangle.
|
void |
setCutOutPadding(int cutOutPadding)
Sets the padding in pixels of the cut out focusElement in relation to the target
element.
|
protected void |
setCutOutStyle() |
void |
setDuration(int duration) |
void |
setOpacity(double opacity) |
void |
setTarget(com.google.gwt.dom.client.Element targetElement)
Sets the target element to be focused by the cut out.
|
void |
setTarget(com.google.gwt.user.client.ui.Widget widget)
Sets the target widget to be focused by the cut out.
|
protected void |
setupComputedBackgroundColor()
Gets the computed background color, based on the backgroundColor CSS
class.
|
protected void |
setupCutOutPosition(com.google.gwt.dom.client.Element cutOut,
com.google.gwt.dom.client.Element relativeTo,
int padding,
boolean circle)
Setups the cut out position when the screen changes size or is scrolled.
|
protected void |
setupTransition() |
protected void |
setupWindowHandlers()
Configures a resize handler and a scroll handler on the window to
properly adjust the Cut Out.
|
$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, 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, isDetectOrientation, isEnabled, isFeatureEnabled, isHoverable, isSeparator, isTruncate, onLoad, onUnload, registerHandler, removeHandler, setAccessKey, setBackfaceVisibility, setBorder, setBorderBottom, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBottom, setCenterOn, setClass, setDataAttribute, setDepth, setDetectOrientation, setDisplay, setEnabled, 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
forEach, spliterator
public MaterialCutOut()
public MaterialCutOut(gwt.material.design.client.constants.Color backgroundColor, Boolean circle, Double opacity)
public void open()
IllegalStateException
- if the target element is null
setTarget(Widget)
protected void setCutOutStyle()
public void close()
close(boolean)
with false
.public void close(boolean autoClosed)
autoClosed
- Notifies with the modal was auto closed or closed by user actionpublic void setBackgroundColor(gwt.material.design.client.constants.Color bgColor)
setBackgroundColor
in interface gwt.material.design.client.base.HasColors
setBackgroundColor
in class gwt.material.design.client.base.MaterialWidget
public gwt.material.design.client.constants.Color getBackgroundColor()
getBackgroundColor
in interface gwt.material.design.client.base.HasColors
getBackgroundColor
in class gwt.material.design.client.base.MaterialWidget
public void setOpacity(double opacity)
setOpacity
in interface gwt.material.design.client.base.HasOpacity
setOpacity
in class gwt.material.design.client.base.MaterialWidget
public double getOpacity()
getOpacity
in interface gwt.material.design.client.base.HasOpacity
getOpacity
in class gwt.material.design.client.base.MaterialWidget
public String getAnimationTimingFunction()
public void setAnimationTimingFunction(String animationTimingFunction)
animationTimingFunction
- The speed curve of the animation, such as ease (the default), linear and
ease-in-outpublic void setCircle(boolean circle)
false
(is a rectangle).setCircle
in interface gwt.material.design.client.base.HasCircle
setCircle
in class gwt.material.design.client.base.MaterialWidget
public boolean isCircle()
isCircle
in interface gwt.material.design.client.base.HasCircle
isCircle
in class gwt.material.design.client.base.MaterialWidget
public void setCutOutPadding(int cutOutPadding)
public int getCutOutPadding()
public void setTarget(com.google.gwt.dom.client.Element targetElement)
public void setTarget(com.google.gwt.user.client.ui.Widget widget)
setTarget(Element)
public com.google.gwt.dom.client.Element getTargetElement()
public void setAnimated(boolean animated)
true
.public boolean isAnimated()
public void setBackgroundSize(String backgroundSize)
backgroundSize
- The size of the background of the Cut Out. You can use any supported
CSS unit for box shadows, such as rem and px.public String getBackgroundSize()
protected void setupCutOutPosition(com.google.gwt.dom.client.Element cutOut, com.google.gwt.dom.client.Element relativeTo, int padding, boolean circle)
protected void setupWindowHandlers()
protected void setupTransition()
protected void setupComputedBackgroundColor()
public com.google.gwt.dom.client.Element getFocusElement()
public void setDuration(int duration)
setDuration
in interface gwt.material.design.client.base.HasDurationTransition
public int getDuration()
getDuration
in interface gwt.material.design.client.base.HasDurationTransition
public com.google.gwt.event.shared.HandlerRegistration addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<MaterialCutOut> handler)
addCloseHandler
in interface com.google.gwt.event.logical.shared.HasCloseHandlers<MaterialCutOut>
public com.google.gwt.event.shared.HandlerRegistration addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<MaterialCutOut> handler)
addOpenHandler
in interface com.google.gwt.event.logical.shared.HasOpenHandlers<MaterialCutOut>
Copyright © 2018. All rights reserved.