Eclipse Remote Application Platform

org.eclipse.rap.rwt.template
Class TextCell

java.lang.Object
  extended by org.eclipse.rap.rwt.template.Cell<TextCell>
      extended by org.eclipse.rap.rwt.template.TextCell
All Implemented Interfaces:
java.io.Serializable

public class TextCell
extends Cell<TextCell>

Defines a region in a template that displays a text.

Since:
2.2
See Also:
Serialized Form

Constructor Summary
TextCell(Template template)
          Constructs a new text cell and adds it to the given template.
 
Method Summary
 TextCell setText(java.lang.String text)
          Sets the text to be displayed in the cell if the bindingIndex is not set.
 TextCell setWrap(boolean wrap)
          Enables automatic line wrapping.
protected  JsonObject toJson()
          Creates a JSON representation of this cell.
 
Methods inherited from class org.eclipse.rap.rwt.template.Cell
setBackground, setBindingIndex, setBottom, setFont, setForeground, setHeight, setHorizontalAlignment, setLeft, setName, setRight, setSelectable, setTop, setVerticalAlignment, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

Parameters:
text - the text to display, must not be null
Returns:
the cell itself, to enable method chaining

setWrap

public TextCell setWrap(boolean wrap)
Enables automatic line wrapping. The default is false.

Parameters:
wrap - true to enable automatic line wrapping
Returns:
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;
 }
 

Overrides:
toJson in class Cell<TextCell>
Returns:
a json object that represents this cell

Eclipse Remote Application Platform

Copyright (c) EclipseSource and others 2002, 2013. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0