com.vaadin.ui.components.grid
Class GridColumn

java.lang.Object
  extended by com.vaadin.ui.components.grid.GridColumn
All Implemented Interfaces:
java.io.Serializable

public class GridColumn
extends java.lang.Object
implements java.io.Serializable

A column in the grid. Can be obtained by calling Grid.getColumn(Object propertyId).

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

Method Summary
protected  void checkColumnIsAttached()
          Checks if column is attached and throws an IllegalStateException if it is not
 java.lang.String getFooterCaption()
          Returns the caption of the footer.
 java.lang.String getHeaderCaption()
          Returns the caption of the header.
 int getWidth()
          Returns the width (in pixels).
 boolean isVisible()
          Is this column visible in the grid.
 void setFooterCaption(java.lang.String caption)
          Sets the caption of the footer.
 void setHeaderCaption(java.lang.String caption)
          Sets the caption of the header.
 void setLastFrozenColumn()
          Sets this column as the last frozen column in its grid.
 void setVisible(boolean visible)
          Set the visibility of this column
 void setWidth(int pixelWidth)
          Sets the width (in pixels).
 void setWidthUndefined()
          Marks the column width as undefined meaning that the grid is free to resize the column based on the cell contents and available space in the grid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHeaderCaption

public java.lang.String getHeaderCaption()
                                  throws java.lang.IllegalStateException
Returns the caption of the header. By default the header caption is the property id of the column.

Returns:
the text in the header
Throws:
java.lang.IllegalStateException - if the column no longer is attached to the grid

setHeaderCaption

public void setHeaderCaption(java.lang.String caption)
                      throws java.lang.IllegalStateException
Sets the caption of the header.

Parameters:
caption - the text to show in the caption
Throws:
java.lang.IllegalStateException - if the column is no longer attached to any grid

getFooterCaption

public java.lang.String getFooterCaption()
                                  throws java.lang.IllegalStateException
Returns the caption of the footer. By default the captions are null.

Returns:
the text in the footer
Throws:
java.lang.IllegalStateException - if the column is no longer attached to any grid

setFooterCaption

public void setFooterCaption(java.lang.String caption)
                      throws java.lang.IllegalStateException
Sets the caption of the footer.

Parameters:
caption - the text to show in the caption
Throws:
java.lang.IllegalStateException - if the column is no longer attached to any grid

getWidth

public int getWidth()
             throws java.lang.IllegalStateException
Returns the width (in pixels). By default a column is 100px wide.

Returns:
the width in pixels of the column
Throws:
java.lang.IllegalStateException - if the column is no longer attached to any grid

setWidth

public void setWidth(int pixelWidth)
              throws java.lang.IllegalStateException,
                     java.lang.IllegalArgumentException
Sets the width (in pixels).

Parameters:
pixelWidth - the new pixel width of the column
Throws:
java.lang.IllegalStateException - if the column is no longer attached to any grid
java.lang.IllegalArgumentException - thrown if pixel width is less than zero

setWidthUndefined

public void setWidthUndefined()
Marks the column width as undefined meaning that the grid is free to resize the column based on the cell contents and available space in the grid.


isVisible

public boolean isVisible()
                  throws java.lang.IllegalStateException
Is this column visible in the grid. By default all columns are visible.

Returns:
true if the column is visible
Throws:
java.lang.IllegalStateException - if the column is no longer attached to any grid

setVisible

public void setVisible(boolean visible)
                throws java.lang.IllegalStateException
Set the visibility of this column

Parameters:
visible - is the column visible
Throws:
java.lang.IllegalStateException - if the column is no longer attached to any grid

checkColumnIsAttached

protected void checkColumnIsAttached()
                              throws java.lang.IllegalStateException
Checks if column is attached and throws an IllegalStateException if it is not

Throws:
java.lang.IllegalStateException - if the column is no longer attached to any grid

setLastFrozenColumn

public void setLastFrozenColumn()
Sets this column as the last frozen column in its grid.

Throws:
java.lang.IllegalArgumentException - if the column is no longer attached to any grid
See Also:
Grid.setLastFrozenColumn(GridColumn)


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