Class TextCell

  • All Implemented Interfaces:

    public class TextCell
    extends Cell<TextCell>
    Defines a region in a template that displays a text.
    See Also:
    Serialized Form
    • Constructor Detail

      • TextCell

        public TextCell​(Template template)
        Constructs a new text cell and adds it to the given template.
    • Method Detail

      • setText

        public TextCell setText​(java.lang.String text)
        Sets the text to be displayed in the cell if the bindingIndex is not set. Can be used to display a static text.
        text - the text to display, must not be null
        the cell itself, to enable method chaining
      • setWrap

        public TextCell setWrap​(boolean wrap)
        Enables automatic line wrapping. The default is false.
        wrap - true to enable automatic line wrapping
        the cell itself, to enable method chaining
      • toJson

        protected JsonObject toJson()
        Description copied from class: Cell
        Creates a JSON representation of this cell. Subclasses can override this method, but must call super and add additional attributes like this:
         protected JsonObject toJson() {
           JsonObject json = super.toJson();
           json.add( "foo", getFoo() );
           return json;
        toJson in class Cell<TextCell>
        a json object that represents this cell