com.vaadin.client.widgets.
Class Grid.StaticSection.StaticCell
- java.lang.Object
-
- com.vaadin.client.widgets.Grid.StaticSection.StaticCell
-
Direct Known Subclasses:
Enclosing class:
Grid.StaticSection<ROWTYPE extends Grid.StaticSection.StaticRow<?>>
public static class Grid.StaticSection.StaticCell extends Object
A header or footer cell. Has a simple textual caption.
-
-
Constructor Summary
Constructors Constructor Description StaticCell()
-
Method Summary
All Methods Modifier and Type Method Description int
getColspan()
Returns the amount of columns the cell spans.
String
getDescription()
Gets the tooltip for the cell.
ContentMode
getDescriptionContentMode()
Gets the content mode for the tooltip.
String
getHtml()
Returns the html inside the cell.
protected Grid.StaticSection<?>
getSection()
Returns the section where this cell belongs.
String
getStyleName()
Returns the custom style name for this cell.
String
getText()
Returns the text displayed in this cell.
GridStaticCellType
getType()
Returns the type of the cell.
com.google.gwt.user.client.ui.Widget
getWidget()
Returns the widget in the cell.
void
setColspan(int colspan)
Sets the amount of columns the cell spans.
void
setDescription(String description)
Sets the tooltip for the cell.
void
setDescription(String description, ContentMode descriptionContentMode)
Sets the tooltip for the cell to be shown with the given content mode.
void
setDescriptionContentMode(ContentMode descriptionContentMode)
Sets the content mode for the tooltip.
void
setHtml(String html)
Sets the content of the cell to the provided html.
protected void
setSection(Grid.StaticSection<?> section)
Sets the section where this cell belongs.
void
setStyleName(String styleName)
Sets a custom style name for this cell.
void
setText(String text)
Sets the text displayed in this cell.
void
setWidget(com.google.gwt.user.client.ui.Widget widget)
Set widget as the content of the cell.
-
-
-
Method Detail
-
setText
public void setText(String text)
Sets the text displayed in this cell.
Parameters:
text
- a plain text caption
-
getText
public String getText()
Returns the text displayed in this cell.
Returns:
the plain text caption
-
getSection
protected Grid.StaticSection<?> getSection()
Returns the section where this cell belongs.
Returns:
the section
-
setSection
protected void setSection(Grid.StaticSection<?> section)
Sets the section where this cell belongs. Should not be null.
Parameters:
section
- the section to set
-
getColspan
public int getColspan()
Returns the amount of columns the cell spans. By default is 1.
Returns:
The amount of columns the cell spans.
-
setColspan
public void setColspan(int colspan)
Sets the amount of columns the cell spans. Must be more or equal to 1. By default is 1.
Parameters:
colspan
- the colspan to set
-
getHtml
public String getHtml()
Returns the html inside the cell.
Returns:
the html content of the cell.
Throws:
IllegalStateException
- if trying to retrive HTML from a cell with a type other thanGridStaticCellType.HTML
.
-
setHtml
public void setHtml(String html)
Sets the content of the cell to the provided html. All previous content is discarded and the cell type is set to
GridStaticCellType.HTML
.Parameters:
html
- The html content of the cell
-
getWidget
public com.google.gwt.user.client.ui.Widget getWidget()
Returns the widget in the cell.
Returns:
the widget in the cell
Throws:
IllegalStateException
- if the cell is notGridStaticCellType.WIDGET
-
setWidget
public void setWidget(com.google.gwt.user.client.ui.Widget widget)
Set widget as the content of the cell. The type of the cell becomes
GridStaticCellType.WIDGET
. All previous content is discarded.Parameters:
widget
- The widget to add to the cell. Should not be previously attached anywhere (widget.getParent == null).
-
getType
public GridStaticCellType getType()
Returns the type of the cell.
Returns:
the type of content the cell contains.
-
getStyleName
public String getStyleName()
Returns the custom style name for this cell.
Returns:
the style name or null if no style name has been set
-
setStyleName
public void setStyleName(String styleName)
Sets a custom style name for this cell.
Parameters:
styleName
- the style name to set or null to not use any style name
-
getDescription
public String getDescription()
Gets the tooltip for the cell.
The tooltip is shown in the mode returned by
getDescriptionContentMode()
.Returns:
the tooltip text for this cell
Since:
8.4
-
setDescription
public void setDescription(String description)
Sets the tooltip for the cell.
By default, tooltips are shown as plain text. For HTML tooltips, see
setDescription(String, ContentMode)
orsetDescriptionContentMode(ContentMode)
.Parameters:
description
- the tooltip to show when hovering the cellSince:
8.4
-
setDescription
public void setDescription(String description, ContentMode descriptionContentMode)
Sets the tooltip for the cell to be shown with the given content mode.
Parameters:
description
- the tooltip to show when hovering the celldescriptionContentMode
- the content mode to use for the tooltip (HTML or plain text)Since:
8.4
See Also:
-
getDescriptionContentMode
public ContentMode getDescriptionContentMode()
Gets the content mode for the tooltip.
The content mode determines how the tooltip is shown.
Returns:
the content mode for the tooltip
Since:
8.4
See Also:
-
setDescriptionContentMode
public void setDescriptionContentMode(ContentMode descriptionContentMode)
Sets the content mode for the tooltip.
Parameters:
descriptionContentMode
- the content mode for the tooltipSince:
8.4
See Also:
-
-