com.vaadin.ui.renderers
Class DateRenderer

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.server.AbstractExtension
          extended by com.vaadin.ui.Grid.AbstractGridExtension
              extended by com.vaadin.ui.Grid.AbstractRenderer<java.util.Date>
                  extended by com.vaadin.ui.renderers.DateRenderer
All Implemented Interfaces:
MethodEventSource, ClientConnector, Extension, com.vaadin.shared.Connector, Renderer<java.util.Date>, java.io.Serializable

public class DateRenderer
extends Grid.AbstractRenderer<java.util.Date>

A renderer for presenting date values.

Since:
7.4
Author:
Vaadin Ltd
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
 
Constructor Summary
DateRenderer()
          Creates a new date renderer.
DateRenderer(java.text.DateFormat dateFormat)
          Creates a new date renderer.
DateRenderer(java.text.DateFormat dateFormat, java.lang.String nullRepresentation)
          Creates a new date renderer.
DateRenderer(java.util.Locale locale)
          Creates a new date renderer.
DateRenderer(java.util.Locale locale, java.lang.String nullRepresentation)
          Creates a new date renderer.
DateRenderer(java.lang.String formatString)
          Creates a new date renderer.
DateRenderer(java.lang.String formatString, java.util.Locale locale)
          Creates a new date renderer.
DateRenderer(java.lang.String formatString, java.util.Locale locale, java.lang.String nullRepresentation)
          Creates a new date renderer.
DateRenderer(java.lang.String formatString, java.lang.String nullRepresentation)
          Creates a new date renderer.
 
Method Summary
 elemental.json.JsonValue encode(java.util.Date value)
          Encodes the given value into a JsonValue.
 java.lang.String getNullRepresentation()
          Null representation for the renderer
 java.lang.String toString()
           
 
Methods inherited from class com.vaadin.ui.Grid.AbstractRenderer
encode, encodeValue, extend, getPresentationType, getSupportedParentType
 
Methods inherited from class com.vaadin.ui.Grid.AbstractGridExtension
addComponentToGrid, getColumn, getItemId, getParentGrid, refreshRow, remove, removeComponentFromGrid
 
Methods inherited from class com.vaadin.server.AbstractExtension
getParent, setParent
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getState, getState, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.renderers.Renderer
remove, setParent
 
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getParent, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 

Constructor Detail

DateRenderer

public DateRenderer()
Creates a new date renderer.

The renderer is configured to render with the Date.toString() representation for the default locale.


DateRenderer

public DateRenderer(java.util.Locale locale)
             throws java.lang.IllegalArgumentException
Creates a new date renderer.

The renderer is configured to render with the Date.toString() representation for the given locale.

Parameters:
locale - the locale in which to present dates
Throws:
java.lang.IllegalArgumentException - if locale is null

DateRenderer

public DateRenderer(java.util.Locale locale,
                    java.lang.String nullRepresentation)
             throws java.lang.IllegalArgumentException
Creates a new date renderer.

The renderer is configured to render with the Date.toString() representation for the given locale.

Parameters:
locale - the locale in which to present dates
nullRepresentation - the textual representation of null value
Throws:
java.lang.IllegalArgumentException - if locale is null

DateRenderer

public DateRenderer(java.lang.String formatString)
             throws java.lang.IllegalArgumentException
Creates a new date renderer.

The renderer is configured to render with the given string format, as displayed in the default locale.

Parameters:
formatString - the format string with which to format the date
Throws:
java.lang.IllegalArgumentException - if formatString is null
See Also:
Format String Syntax

DateRenderer

public DateRenderer(java.lang.String formatString,
                    java.lang.String nullRepresentation)
             throws java.lang.IllegalArgumentException
Creates a new date renderer.

The renderer is configured to render with the given string format, as displayed in the default locale.

Parameters:
formatString - the format string with which to format the date
nullRepresentation - the textual representation of null value
Throws:
java.lang.IllegalArgumentException - if formatString is null
See Also:
Format String Syntax

DateRenderer

public DateRenderer(java.lang.String formatString,
                    java.util.Locale locale)
             throws java.lang.IllegalArgumentException
Creates a new date renderer.

The renderer is configured to render with the given string format, as displayed in the given locale.

Parameters:
formatString - the format string to format the date with
locale - the locale to use
Throws:
java.lang.IllegalArgumentException - if either argument is null
See Also:
Format String Syntax

DateRenderer

public DateRenderer(java.lang.String formatString,
                    java.util.Locale locale,
                    java.lang.String nullRepresentation)
             throws java.lang.IllegalArgumentException
Creates a new date renderer.

The renderer is configured to render with the given string format, as displayed in the given locale.

Parameters:
formatString - the format string to format the date with
locale - the locale to use
nullRepresentation - the textual representation of null value
Throws:
java.lang.IllegalArgumentException - if either argument is null
See Also:
Format String Syntax

DateRenderer

public DateRenderer(java.text.DateFormat dateFormat)
             throws java.lang.IllegalArgumentException
Creates a new date renderer.

The renderer is configured to render with he given date format.

Parameters:
dateFormat - the date format to use when rendering dates
Throws:
java.lang.IllegalArgumentException - if dateFormat is null

DateRenderer

public DateRenderer(java.text.DateFormat dateFormat,
                    java.lang.String nullRepresentation)
             throws java.lang.IllegalArgumentException
Creates a new date renderer.

The renderer is configured to render with he given date format.

Parameters:
dateFormat - the date format to use when rendering dates
Throws:
java.lang.IllegalArgumentException - if dateFormat is null
Method Detail

getNullRepresentation

public java.lang.String getNullRepresentation()
Description copied from class: Grid.AbstractRenderer
Null representation for the renderer

Overrides:
getNullRepresentation in class Grid.AbstractRenderer<java.util.Date>
Returns:
a textual representation of null

encode

public elemental.json.JsonValue encode(java.util.Date value)
Description copied from interface: Renderer
Encodes the given value into a JsonValue.

Specified by:
encode in interface Renderer<java.util.Date>
Overrides:
encode in class Grid.AbstractRenderer<java.util.Date>
Parameters:
value - the value to encode
Returns:
a JSON representation of the given value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.