public class MaterialSwitch extends AbstractValueWidget<Boolean> implements com.google.gwt.user.client.ui.HasValue<Boolean>
<m:MaterialSwitch value="true"/>
<m:MaterialSwitch value="true" disabled="true"/>
MaterialWidget.Featurecom.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabledcom.google.gwt.editor.client.Editor.Ignore, com.google.gwt.editor.client.Editor.Path$this| Constructor and Description |
|---|
MaterialSwitch()
Creates a switch element
|
MaterialSwitch(boolean value)
Creates a material switch with default value.
|
MaterialSwitch(String onLabel,
String offLabel) |
MaterialSwitch(String onLabel,
String offLabel,
Boolean value) |
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Boolean> handler) |
void |
clearErrorOrSuccess()
Clear the error or success states.
|
MaterialLabel |
getErrorLabel() |
protected ErrorMixin<AbstractValueWidget,MaterialLabel> |
getErrorMixin() |
MaterialInput |
getInput() |
Label |
getLabel() |
Span |
getOffLabel() |
Span |
getOnLabel() |
Span |
getSpan() |
Boolean |
getValue()
Gets the value of switch component.
|
protected void |
onLoad() |
void |
setEnabled(boolean enabled) |
void |
setError(String error)
Errors occur when an app fails to complete what is expected, such as:
- The app does not understand user input
- The system or app fails
- A user intends to run incompatible operations concurrently
|
void |
setHelperText(String helperText)
Apply a widgets help text.
|
void |
setInput(MaterialInput input) |
void |
setLabel(Label label)
Deprecated.
|
void |
setOffLabel(String label)
Set the Off State Label of the switch component
|
void |
setOnLabel(String label)
Set the On State Label of the switch component
|
void |
setSpan(Span span) |
void |
setSuccess(String success)
Set the success message marking a widget as success.
|
void |
setValue(Boolean value) |
void |
setValue(Boolean value,
boolean fireEvents)
Set the value of switch component.
|
addValidationChangedHandler, addValidator, createBlankValidator, getErrorHandler, getErrorHandlerMixin, getErrorHandlerType, getValidatorMixin, isAllowBlank, isValidateOnBlur, removeValidator, reset, setAllowBlank, setErrorHandler, setErrorHandlerType, setupBlurValidation, setValidateOnBlur, setValidators, setValue, showErrors, validate, validate$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, getOpacity, 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, 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, setOpacity, 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, windowadd, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, iterator, remove, 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, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetVisibleforEach, spliteratorpublic MaterialSwitch()
public MaterialSwitch(String onLabel, String offLabel)
public MaterialSwitch(String onLabel, String offLabel, Boolean value)
public MaterialSwitch(boolean value)
protected void onLoad()
onLoad in class MaterialWidgetpublic void setEnabled(boolean enabled)
setEnabled in interface com.google.gwt.user.client.ui.HasEnabledsetEnabled in class MaterialWidgetpublic void setValue(Boolean value, boolean fireEvents)
setValue in interface com.google.gwt.user.client.ui.HasValue<Boolean>setValue in class AbstractValueWidget<Boolean>public void setValue(Boolean value)
setValue in interface com.google.gwt.user.client.TakesValue<Boolean>setValue in interface com.google.gwt.user.client.ui.HasValue<Boolean>setValue in class AbstractValueWidget<Boolean>public MaterialInput getInput()
public void setInput(MaterialInput input)
input - the input to set@Deprecated public void setLabel(Label label)
label - the label to setpublic void setError(String error)
HasErrorsetError in interface HasErrorsetError in class AbstractValueWidget<Boolean>public void setSuccess(String success)
HasErrorsetSuccess in interface HasErrorsetSuccess in class AbstractValueWidget<Boolean>public void setHelperText(String helperText)
HasErrorsetHelperText in interface HasErrorsetHelperText in class AbstractValueWidget<Boolean>public void clearErrorOrSuccess()
HasErrorclearErrorOrSuccess in interface HasErrorclearErrorOrSuccess in class AbstractValueWidget<Boolean>public void setOnLabel(String label)
public void setOffLabel(String label)
public MaterialLabel getErrorLabel()
public Span getOnLabel()
public Span getOffLabel()
public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Boolean> handler)
addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<Boolean>addValueChangeHandler in class AbstractValueWidget<Boolean>protected ErrorMixin<AbstractValueWidget,MaterialLabel> getErrorMixin()
getErrorMixin in class AbstractValueWidget<Boolean>Copyright © 2018. All rights reserved.