public class DateRenderer extends AbstractRenderer<Object,Date>
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Constructor and Description |
---|
DateRenderer()
Creates a new date renderer.
|
DateRenderer(DateFormat dateFormat)
Creates a new date renderer.
|
DateRenderer(DateFormat dateFormat,
String nullRepresentation)
Creates a new date renderer.
|
DateRenderer(Locale locale)
Creates a new date renderer.
|
DateRenderer(Locale locale,
String nullRepresentation)
Creates a new date renderer.
|
DateRenderer(String formatString)
Creates a new date renderer.
|
DateRenderer(String formatString,
Locale locale)
Creates a new date renderer.
|
DateRenderer(String formatString,
Locale locale,
String nullRepresentation)
Creates a new date renderer.
|
DateRenderer(String formatString,
String nullRepresentation)
Creates a new date renderer.
|
Modifier and Type | Method and Description |
---|---|
JsonValue |
encode(Date value)
Encodes the given value into a
JsonValue . |
String |
getNullRepresentation()
Null representation for the renderer.
|
protected DateRendererState |
getState()
Returns the shared state for this connector.
|
protected DateRendererState |
getState(boolean markAsDirty)
Returns the shared state for this connector.
|
String |
toString() |
encode, extend, getParent, getParentGrid, getPresentationType, getSupportedParentType
remove, setParent
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
public DateRenderer()
The renderer is configured to render with the Date.toString()
representation for the default locale.
public DateRenderer(Locale locale) throws IllegalArgumentException
The renderer is configured to render with the Date.toString()
representation for the given locale.
locale
- the locale in which to present datesIllegalArgumentException
- if locale
is null
public DateRenderer(Locale locale, String nullRepresentation) throws IllegalArgumentException
The renderer is configured to render with the Date.toString()
representation for the given locale.
locale
- the locale in which to present datesnullRepresentation
- the textual representation of null
valueIllegalArgumentException
- if locale
is null
public DateRenderer(String formatString) throws IllegalArgumentException
The renderer is configured to render with the given string format, as displayed in the default locale.
formatString
- the format string with which to format the dateIllegalArgumentException
- if formatString
is null
public DateRenderer(String formatString, String nullRepresentation) throws IllegalArgumentException
The renderer is configured to render with the given string format, as displayed in the default locale.
formatString
- the format string with which to format the datenullRepresentation
- the textual representation of null
valueIllegalArgumentException
- if formatString
is null
public DateRenderer(String formatString, Locale locale) throws IllegalArgumentException
The renderer is configured to render with the given string format, as displayed in the given locale.
formatString
- the format string to format the date withlocale
- the locale to useIllegalArgumentException
- if either argument is null
public DateRenderer(String formatString, Locale locale, String nullRepresentation) throws IllegalArgumentException
The renderer is configured to render with the given string format, as displayed in the given locale.
formatString
- the format string to format the date withlocale
- the locale to usenullRepresentation
- the textual representation of null
valueIllegalArgumentException
- if either argument is null
public DateRenderer(DateFormat dateFormat) throws IllegalArgumentException
The renderer is configured to render with he given date format.
dateFormat
- the date format to use when rendering datesIllegalArgumentException
- if dateFormat
is null
public DateRenderer(DateFormat dateFormat, String nullRepresentation) throws IllegalArgumentException
The renderer is configured to render with he given date format.
dateFormat
- the date format to use when rendering datesIllegalArgumentException
- if dateFormat
is null
public String getNullRepresentation()
AbstractRenderer
getNullRepresentation
in class AbstractRenderer<Object,Date>
null
public JsonValue encode(Date value)
Renderer
JsonValue
.protected DateRendererState getState()
AbstractClientConnector
As a side effect, marks the connector dirty so any changes done to the
state will be sent to the client. Use getState(false)
to avoid
marking the connector as dirty.
getState
in class AbstractRenderer<Object,Date>
protected DateRendererState getState(boolean markAsDirty)
AbstractClientConnector
getState
in class AbstractRenderer<Object,Date>
markAsDirty
- true if the connector should automatically be marked dirty,
false otherwiseAbstractClientConnector.getState()
Copyright © 2018 Vaadin Ltd. All rights reserved.