public class MaterialDatePicker extends MaterialWidget implements HasGrid, HasError, HasOrientation, HasPlaceholder, com.google.gwt.user.client.ui.HasValue<Date>, com.google.gwt.event.logical.shared.HasOpenHandlers<MaterialDatePicker>, com.google.gwt.event.logical.shared.HasCloseHandlers<MaterialDatePicker>, com.google.gwt.editor.client.HasEditorErrors<Date>, HasErrorHandler, HasValidators<Date>, HasBlankValidator, com.google.gwt.event.dom.client.HasBlurHandlers, HasIcon
<m:MaterialDatePicker ui:field="datePicker">
datePicker.setDate(new Date());
| Modifier and Type | Class and Description |
|---|---|
static class |
MaterialDatePicker.MaterialDatePickerType
Enum for identifying various selection types for the picker.
|
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| Constructor and Description |
|---|
MaterialDatePicker() |
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addBlurHandler(com.google.gwt.event.dom.client.BlurHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<MaterialDatePicker> handler) |
com.google.gwt.event.shared.HandlerRegistration |
addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<MaterialDatePicker> handler) |
com.google.gwt.event.shared.HandlerRegistration |
addValidationChangedHandler(ValidationChangedEvent.ValidationChangedHandler handler)
Adds a validation changed handler.
|
void |
addValidator(Validator<Date> validator)
Adds the validator.
|
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Date> handler) |
void |
clear() |
void |
clearErrorOrSuccess() |
void |
clearValues()
Clears the values of the picker field.
|
void |
clearValues(com.google.gwt.dom.client.Element picker) |
Date |
getDate()
Same as calling
getValue() |
Date |
getDateMax() |
Date |
getDateMin() |
static com.google.gwt.core.client.JsDate |
getDatePickerValue(com.google.gwt.dom.client.Element picker) |
ErrorHandler |
getErrorHandler()
Gets the error handler.
|
ErrorHandlerType |
getErrorHandlerType()
Gets the error handler type.
|
String |
getFormat() |
MaterialIcon |
getIcon()
Get the icon widget.
|
DatePickerLanguage |
getLanguage() |
Orientation |
getOrientation() |
protected Date |
getPickerDate() |
static String |
getPickerId(com.google.gwt.dom.client.Element inputSrc) |
String |
getPlaceholder() |
MaterialDatePicker.MaterialDatePickerType |
getSelectionType() |
Date |
getValue() |
static com.google.gwt.dom.client.Element |
initDatePicker(com.google.gwt.dom.client.Element inputSrc,
String typeName,
String format) |
boolean |
isAllowBlank() |
boolean |
isIconPrefix()
Is the icon prefix in the container.
|
boolean |
isValidateOnBlur()
Gets the validate on blur.
|
protected void |
onAttach() |
protected void |
onDetach() |
void |
reinitialize()
Re initialize the datepicker
|
void |
removeErrorModifiers() |
boolean |
removeValidator(Validator<Date> validator)
Removes the validator.
|
void |
reset()
Reset the form element to blank and clear error messages.
|
void |
setAllowBlank(boolean allowBlank) |
void |
setDate(Date date)
Sets the current date of the picker.
|
void |
setDateMax(Date dateMax) |
void |
setDateMin(Date dateMin) |
void |
setDateSelectionType(MaterialDatePicker.MaterialDatePickerType type)
Sets the type of selection options (date, month, year,...).
|
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 |
setErrorHandler(ErrorHandler errorHandler)
Sets the error handler.
|
void |
setErrorHandlerType(ErrorHandlerType errorHandlerType)
Sets the error handler type.
|
void |
setFormat(String format)
To call before initialization
|
void |
setGrid(String grid)
Setting the grid for responsiveness don't forget to build rows first before setting
the grid on each material widgets.
|
void |
setHelperText(String helperText) |
void |
setIconColor(String iconColor)
Sets the color of the icon.
|
void |
setIconFontSize(double size,
com.google.gwt.dom.client.Style.Unit unit)
Set the font size of the icon.
|
void |
setIconPosition(IconPosition position)
Set the position of the icon.
|
void |
setIconPrefix(boolean prefix)
Make the icon prefix in its container.
|
void |
setIconSize(IconSize size)
Size of icon.
|
void |
setIconType(IconType iconType)
Set Material Design icon.
|
void |
setLanguage(DatePickerLanguage language) |
void |
setOffset(String offset)
Setting the offset.
|
void |
setOrientation(Orientation orientation) |
void |
setPickerDate(com.google.gwt.core.client.JsDate date,
com.google.gwt.dom.client.Element picker) |
void |
setPickerDateMax(com.google.gwt.core.client.JsDate date,
com.google.gwt.dom.client.Element picker) |
void |
setPickerDateMin(com.google.gwt.core.client.JsDate date,
com.google.gwt.dom.client.Element picker) |
void |
setPlaceholder(String placeholder) |
void |
setSelectionType(MaterialDatePicker.MaterialDatePickerType selectionType) |
void |
setSuccess(String success) |
void |
setValidateOnBlur(boolean validateOnBlur)
Sets the validate on blur.
|
void |
setValidators(Validator<Date>... validators)
The validators used to validate this object.
|
void |
setValue(Date value) |
void |
setValue(Date value,
boolean fireEvents) |
void |
showErrors(List<com.google.gwt.editor.client.EditorError> errors) |
void |
stop()
Stop the datepicker instance
|
protected void |
stop(com.google.gwt.dom.client.Element picker) |
boolean |
validate()
Validate the field's value using the supplied validators.
|
boolean |
validate(boolean show)
Validate the field's value using the supplied validators.
|
add, add, clearActiveClass, enableFeature, getBackgroundColor, getCenterOn, getCenterOnMixin, getCircleMixin, getColorsMixin, getDataAttribute, getDepth, getEnabledMixin, getFlexboxMixin, getFloat, getFloatMixin, getFocusableMixin, getFontSize, getFontSizeMixin, getFontWeight, getFontWeightMixin, getGridMixin, getHideOn, getHideOnMixin, getHoverableMixin, getId, getIdMixin, getInitialClasses, getOpacity, getScrollspy, getScrollspyMixin, getSeparatorMixin, getShadow, getShadowMixin, getShowOn, getShowOnMixin, getTabIndex, getTextAlign, getTextAlignMixin, getTextColor, getTooltip, getTooltipDelayMs, getTooltipMixin, getTooltipPosition, getTruncateMixin, getWaves, getWavesMixin, getWidth, getWidth, insert, insert, isCircle, isEnabled, isFeatureEnabled, isHoverable, isSeparator, onLoad, setAccessKey, setBackgroundColor, setBottom, setCenterOn, setCircle, setDataAttribute, setDepth, setDisplay, setFlex, setFlexAlignContent, setFlexAlignItems, setFlexAlignSelf, setFlexBasis, setFlexDirection, setFlexGrow, setFlexJustifyContent, setFlexOrder, setFlexShrink, setFlexWrap, setFloat, setFocus, setFontSize, setFontSize, setFontWeight, setGwtDisplay, setHideOn, setHoverable, setId, setInitialClasses, setLayoutPosition, setLeft, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setOpacity, setOverflow, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setRight, setScrollspy, setSeparator, setShadow, setShowOn, setTabIndex, setTextAlign, setTextColor, setTooltip, setTooltipDelayMs, setTooltipPosition, setTop, setTruncate, setVisibility, setWaves, stopTouchStartEvent, stopTouchStartEventadd, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, iterator, remove, removeadd, adopt, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onUnload, 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 MaterialDatePicker()
protected void onAttach()
onAttach in class com.google.gwt.user.client.ui.Widgetprotected void onDetach()
onDetach in class com.google.gwt.user.client.ui.Widgetpublic void clear()
clear in interface com.google.gwt.user.client.ui.HasWidgetsclear in class com.google.gwt.user.client.ui.Panelpublic void removeErrorModifiers()
public void setDateSelectionType(MaterialDatePicker.MaterialDatePickerType type)
type - if null, MaterialDatePicker.MaterialDatePickerType.DAY will be used as fallback.public static String getPickerId(com.google.gwt.dom.client.Element inputSrc)
public static com.google.gwt.dom.client.Element initDatePicker(com.google.gwt.dom.client.Element inputSrc, String typeName, String format)
public void setDate(Date date)
date - - must not be nullpublic Date getDateMin()
public void setDateMin(Date dateMin)
public void setPickerDateMin(com.google.gwt.core.client.JsDate date, com.google.gwt.dom.client.Element picker)
public Date getDateMax()
public void setDateMax(Date dateMax)
public void setPickerDateMax(com.google.gwt.core.client.JsDate date, com.google.gwt.dom.client.Element picker)
public void setPickerDate(com.google.gwt.core.client.JsDate date, com.google.gwt.dom.client.Element picker)
public Date getDate()
getValue()protected Date getPickerDate()
public static com.google.gwt.core.client.JsDate getDatePickerValue(com.google.gwt.dom.client.Element picker)
public void clearValues()
public void clearValues(com.google.gwt.dom.client.Element picker)
public String getPlaceholder()
getPlaceholder in interface HasPlaceholderpublic void setPlaceholder(String placeholder)
setPlaceholder in interface HasPlaceholderpublic MaterialDatePicker.MaterialDatePickerType getSelectionType()
public void setSelectionType(MaterialDatePicker.MaterialDatePickerType selectionType)
public Orientation getOrientation()
getOrientation in interface HasOrientationpublic void setOrientation(Orientation orientation)
setOrientation in interface HasOrientationorientation - the orientation to set : can be Vertical or Horizontalpublic void setGrid(String grid)
HasGridsetGrid in interface HasGridsetGrid in class MaterialWidgetpublic void setOffset(String offset)
HasGridsetOffset in interface HasGridsetOffset in class MaterialWidgetpublic void setError(String error)
HasErrorpublic void setSuccess(String success)
setSuccess in interface HasErrorpublic void setHelperText(String helperText)
setHelperText in interface HasErrorpublic void clearErrorOrSuccess()
clearErrorOrSuccess in interface HasErrorpublic com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Date> handler)
addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<Date>public void setValue(Date value, boolean fireEvents)
setValue in interface com.google.gwt.user.client.ui.HasValue<Date>public com.google.gwt.event.shared.HandlerRegistration addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<MaterialDatePicker> handler)
addCloseHandler in interface com.google.gwt.event.logical.shared.HasCloseHandlers<MaterialDatePicker>public com.google.gwt.event.shared.HandlerRegistration addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<MaterialDatePicker> handler)
addOpenHandler in interface com.google.gwt.event.logical.shared.HasOpenHandlers<MaterialDatePicker>public com.google.gwt.event.shared.HandlerRegistration addBlurHandler(com.google.gwt.event.dom.client.BlurHandler handler)
addBlurHandler in interface com.google.gwt.event.dom.client.HasBlurHandlerspublic void setEnabled(boolean enabled)
setEnabled in interface com.google.gwt.user.client.ui.HasEnabledsetEnabled in class MaterialWidgetpublic boolean isAllowBlank()
isAllowBlank in interface HasBlankValidatorpublic void setAllowBlank(boolean allowBlank)
setAllowBlank in interface HasBlankValidatorallowBlank - the new allow blankpublic void showErrors(List<com.google.gwt.editor.client.EditorError> errors)
showErrors in interface com.google.gwt.editor.client.HasEditorErrors<Date>public ErrorHandler getErrorHandler()
HasErrorHandlergetErrorHandler in interface HasErrorHandlerpublic void setErrorHandler(ErrorHandler errorHandler)
HasErrorHandlersetErrorHandler in interface HasErrorHandlererrorHandler - the new error handlerpublic ErrorHandlerType getErrorHandlerType()
HasErrorHandlergetErrorHandlerType in interface HasErrorHandlerpublic void setErrorHandlerType(ErrorHandlerType errorHandlerType)
HasErrorHandlersetErrorHandlerType in interface HasErrorHandlererrorHandlerType - the new error handler typepublic void addValidator(Validator<Date> validator)
HasValidatorsaddValidator in interface HasValidators<Date>validator - the validatorpublic boolean isValidateOnBlur()
HasValidatorsisValidateOnBlur in interface HasValidators<Date>public boolean removeValidator(Validator<Date> validator)
HasValidatorsremoveValidator in interface HasValidators<Date>validator - the validatorpublic void reset()
HasValidatorsreset in interface HasValidators<Date>public void setValidateOnBlur(boolean validateOnBlur)
HasValidatorssetValidateOnBlur in interface HasValidators<Date>validateOnBlur - the new validate on blurpublic void setValidators(Validator<Date>... validators)
HasValidatorssetValidators in interface HasValidators<Date>validators - the new validatorspublic boolean validate()
HasValidatorsvalidate in interface HasValidators<Date>public boolean validate(boolean show)
HasValidatorsvalidate in interface HasValidators<Date>show - the error to the user.public com.google.gwt.event.shared.HandlerRegistration addValidationChangedHandler(ValidationChangedEvent.ValidationChangedHandler handler)
ValidationChangedEvent.HasValidationChangedHandlersaddValidationChangedHandler in interface ValidationChangedEvent.HasValidationChangedHandlershandler - the handlerpublic DatePickerLanguage getLanguage()
public void setLanguage(DatePickerLanguage language)
public void reinitialize()
public void stop()
protected void stop(com.google.gwt.dom.client.Element picker)
public MaterialIcon getIcon()
HasIconpublic void setIconType(IconType iconType)
HasIconhttps://www.google.com/design/icons/setIconType in interface HasIconpublic void setIconPosition(IconPosition position)
HasIconsetIconPosition in interface HasIconpublic void setIconSize(IconSize size)
HasIconsetIconSize in interface HasIconpublic void setIconFontSize(double size, com.google.gwt.dom.client.Style.Unit unit)
HasIconsetIconFontSize in interface HasIconpublic void setIconColor(String iconColor)
HasIconsetIconColor in interface HasIconpublic void setIconPrefix(boolean prefix)
HasIconsetIconPrefix in interface HasIconpublic boolean isIconPrefix()
HasIconisIconPrefix in interface HasIconCopyright © 2016. All rights reserved.