com.vaadin.addon.touchkit.ui
Class DatePicker

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.ui.AbstractComponent
          extended by com.vaadin.ui.AbstractField<Date>
              extended by com.vaadin.addon.touchkit.ui.DatePicker
All Implemented Interfaces:
com.vaadin.data.Buffered, com.vaadin.data.BufferedValidatable, com.vaadin.data.Property<Date>, com.vaadin.data.Property.Editor, com.vaadin.data.Property.ReadOnlyStatusChangeListener, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.ValueChangeListener, com.vaadin.data.Property.ValueChangeNotifier, com.vaadin.data.Property.Viewer, com.vaadin.data.Validatable, com.vaadin.event.Action.ShortcutNotifier, com.vaadin.event.MethodEventSource, com.vaadin.server.ClientConnector, com.vaadin.server.Sizeable, com.vaadin.shared.Connector, com.vaadin.ui.Component, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Field<Date>, Serializable

public class DatePicker
extends com.vaadin.ui.AbstractField<Date>

DatePicker is a field used to ask time values from the user. In contrast to the standard Vaadin DateField, this component shows a native DatePicker in browsers that support this. Browsers that do not support native date pickers show a touch friendly fallback. Browsers that have good support for native date pickers:

Earlier versions of Android have very limited support for native date pickers.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField
com.vaadin.ui.AbstractField.FocusShortcut, com.vaadin.ui.AbstractField.ReadOnlyStatusChangeEvent
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Field
com.vaadin.ui.Field.ValueChangeEvent
 
Nested classes/interfaces inherited from interface com.vaadin.data.Buffered
com.vaadin.data.Buffered.SourceException
 
Nested classes/interfaces inherited from interface com.vaadin.data.Property
com.vaadin.data.Property.Editor, com.vaadin.data.Property.ReadOnlyException, com.vaadin.data.Property.ReadOnlyStatusChangeListener, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.Transactional<T>, com.vaadin.data.Property.ValueChangeListener, com.vaadin.data.Property.ValueChangeNotifier, com.vaadin.data.Property.Viewer
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
com.vaadin.server.Sizeable.Unit
 
Field Summary
 
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Constructor Summary
DatePicker()
          Constructs a new DatePicker instance with day resolution.
DatePicker(String caption)
          Constructs a new DatePicker instance with day resolution and the specified caption.
 
Method Summary
 void beforeClientResponse(boolean initial)
           
 Date getMax()
           
 Date getMin()
           
 DatePickerState.Resolution getResolution()
           
protected  DatePickerState getState()
           
 Class<Date> getType()
           
 boolean isUseNative()
           
 void setMax(Date max)
          Sets the maximum date value accepted from the user.
 void setMin(Date min)
          Sets the minimum date value accepted from the user.
 void setResolution(DatePickerState.Resolution resolution)
          Sets the current resolution of this DatePicker
 void setUseNative(boolean useNative)
          Sets whether to use native date field when possible or always use the fallback.
 
Methods inherited from class com.vaadin.ui.AbstractField
addListener, addListener, addReadOnlyStatusChangeListener, addValidator, addValueChangeListener, attach, commit, detach, discard, fireReadOnlyStatusChange, fireValueChange, focus, getConversionError, getConversionError, getConvertedValue, getConverter, getCurrentBufferedSourceException, getErrorMessage, getInternalValue, getModelType, getPropertyDataSource, getRequiredError, getState, getTabIndex, getValidators, getValue, isBuffered, isEmpty, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isRequired, isValid, isValidationVisible, readOnlyStatusChange, removeAllValidators, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValidator, removeValueChangeListener, setBuffered, setConversionError, setConvertedValue, setConverter, setConverter, setCurrentBufferedSourceException, setInternalValue, setInvalidAllowed, setInvalidCommitted, setLocale, setPropertyDataSource, setReadOnly, setRequired, setRequiredError, setTabIndex, setValidationVisible, setValue, setValue, shouldHideErrors, toString, validate, validate, valueChange
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addShortcutListener, addStyleName, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isConnectorEnabled, isEnabled, isImmediate, isVisible, removeListener, removeShortcutListener, removeStyleName, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeight, setIcon, setId, setImmediate, setParent, setPrimaryStyleName, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hasListeners, isAttached, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setVisible
 
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setSizeFull, setSizeUndefined, setWidth, setWidth
 
Methods inherited from interface com.vaadin.event.Action.ShortcutNotifier
addShortcutListener, removeShortcutListener
 

Constructor Detail

DatePicker

public DatePicker()
Constructs a new DatePicker instance with day resolution.


DatePicker

public DatePicker(String caption)
Constructs a new DatePicker instance with day resolution and the specified caption.

Parameters:
caption - The caption
Method Detail

getType

public Class<Date> getType()
Specified by:
getType in interface com.vaadin.data.Property<Date>
Specified by:
getType in class com.vaadin.ui.AbstractField<Date>

getState

protected DatePickerState getState()
Overrides:
getState in class com.vaadin.ui.AbstractField<Date>

beforeClientResponse

public void beforeClientResponse(boolean initial)
Specified by:
beforeClientResponse in interface com.vaadin.server.ClientConnector
Overrides:
beforeClientResponse in class com.vaadin.ui.AbstractField<Date>

getResolution

public DatePickerState.Resolution getResolution()
Returns:
The current resolution

setResolution

public void setResolution(DatePickerState.Resolution resolution)
Sets the current resolution of this DatePicker

Parameters:
resolution - The resolution. Not all resolutions are supported on all devices.

setUseNative

public void setUseNative(boolean useNative)
Sets whether to use native date field when possible or always use the fallback. E.g. iOS Safari fully supports native date fields since iOS version 5.

Parameters:
useNative - If true native date field is used with browsers supporting it

isUseNative

public boolean isUseNative()
Returns:
true if native date field is used in supported browsers.

setMin

public void setMin(Date min)
Sets the minimum date value accepted from the user. Notice that, in native mode, this is supported only by some devices. This function is here for future use.

Parameters:
min - The minimum date value accepted from the user. Set to null to clear. The value must be before the maximum date value (if defined).

getMin

public Date getMin()
Returns:
The minimum date value accepted from the user, null if undefined.

setMax

public void setMax(Date max)
Sets the maximum date value accepted from the user. Notice that, in native mode, this is supported only by some devices. This function is here for future use.

Parameters:
max - Maximum date value accepted from the user. Set to null to clear. The value must be after the minimum date value (if defined).

getMax

public Date getMax()
Returns:
The maximum date value accepted from the user, null if undefined.


Copyright © 2014 Vaadin Ltd. All rights reserved.