Class TextRenderer

  • All Implemented Interfaces:
    MethodEventSource, ClientConnector, Extension, com.vaadin.shared.Connector, Renderer<java.lang.Object>, java.io.Serializable

    public class TextRenderer
    extends AbstractRenderer<java.lang.Object,​java.lang.Object>
    A renderer for presenting a plain text representation of any value. Object.toString() is used for determining the text to show.
    Since:
    7.4
    Author:
    Vaadin Ltd
    See Also:
    Serialized Form
    • Constructor Detail

      • TextRenderer

        public TextRenderer()
        Creates a new text renderer that uses "" to represent null values.
      • TextRenderer

        public TextRenderer​(java.lang.String nullRepresentation)
        Creates a new text renderer with the given string to represent null values.
        Parameters:
        nullRepresentation - the textual representation of null value
    • Method Detail

      • encode

        public elemental.json.JsonValue encode​(java.lang.Object value)
        Description copied from interface: Renderer
        Encodes the given value into a JsonValue.
        Specified by:
        encode in interface Renderer<java.lang.Object>
        Overrides:
        encode in class AbstractRenderer<java.lang.Object,​java.lang.Object>
        Parameters:
        value - the value to encode
        Returns:
        a JSON representation of the given value
      • getNullRepresentation

        public java.lang.String getNullRepresentation()
        Description copied from class: AbstractRenderer
        Null representation for the renderer.
        Overrides:
        getNullRepresentation in class AbstractRenderer<java.lang.Object,​java.lang.Object>
        Returns:
        a textual representation of null
      • getState

        protected com.vaadin.shared.ui.grid.renderers.TextRendererState getState()
        Description copied from class: AbstractClientConnector
        Returns the shared state for this connector. The shared state object is shared between the server connector and the client connector. Changes are only communicated from the server to the client and not in the other direction.

        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.

        Overrides:
        getState in class AbstractRenderer<java.lang.Object,​java.lang.Object>
        Returns:
        The shared state for this connector. Never null.
      • getState

        protected com.vaadin.shared.ui.grid.renderers.TextRendererState getState​(boolean markAsDirty)
        Description copied from class: AbstractClientConnector
        Returns the shared state for this connector.
        Overrides:
        getState in class AbstractRenderer<java.lang.Object,​java.lang.Object>
        Parameters:
        markAsDirty - true if the connector should automatically be marked dirty, false otherwise
        Returns:
        The shared state for this connector. Never null.
        See Also:
        AbstractClientConnector.getState()