com.vaadin.ui
Class Grid.Header

java.lang.Object
  extended by com.vaadin.ui.Grid.Header
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
Grid

protected static class Grid.Header
extends java.lang.Object

Represents the header section of a Grid.

See Also:
Serialized Form

Field Summary
protected  Grid grid
           
protected  java.util.List<ROWTYPE> rows
           
 
Constructor Summary
protected Grid.Header(Grid grid)
           
 
Method Summary
protected  void addColumn(java.lang.Object propertyId)
          Adds a column for given property id to the section.
 ROWTYPE addRowAt(int index)
          Inserts a new row at the given position.
 ROWTYPE appendRow()
          Adds a new row at the bottom of this section.
protected  Grid.HeaderRow createRow()
           
 Grid.HeaderRow getDefaultRow()
          Returns the current default row of this header.
 ROWTYPE getRow(int rowIndex)
          Gets row at given index.
 int getRowCount()
          Gets the amount of rows in this section.
protected  com.vaadin.shared.ui.grid.GridStaticSectionState getSectionState()
           
 boolean isVisible()
          Returns the visibility of this section.
protected  void markAsDirty()
          Informs the grid that state has changed and it should be redrawn.
 ROWTYPE prependRow()
          Adds a new row at the top of this section.
protected  void readDesign(org.jsoup.nodes.Element tableSectionElement, DesignContext designContext)
          Writes the declarative design from the given table section element.
protected  void removeColumn(java.lang.Object propertyId)
          Removes a column for given property id from the section.
 Grid.HeaderRow removeRow(int rowIndex)
          Removes the row at the given position.
 void removeRow(ROWTYPE row)
          Removes the given row from the section.
protected  void sanityCheck()
          Performs a sanity check that section is in correct state.
 void setDefaultRow(Grid.HeaderRow row)
          Sets the default row of this header.
 void setVisible(boolean visible)
          Sets the visibility of the whole section.
protected  void writeDesign(org.jsoup.nodes.Element tableSectionElement, DesignContext designContext)
          Writes the declarative design to the given table section element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

grid

protected Grid grid

rows

protected java.util.List<ROWTYPE extends com.vaadin.ui.Grid.StaticSection.StaticRow<?>> rows
Constructor Detail

Grid.Header

protected Grid.Header(Grid grid)
Method Detail

setDefaultRow

public void setDefaultRow(Grid.HeaderRow row)
Sets the default row of this header. The default row is a special header row providing a user interface for sorting columns.

Parameters:
row - the new default row, or null for no default row
Throws:
java.lang.IllegalArgumentException - this header does not contain the row

getDefaultRow

public Grid.HeaderRow getDefaultRow()
Returns the current default row of this header. The default row is a special header row providing a user interface for sorting columns.

Returns:
the default row or null if no default row set

getSectionState

protected com.vaadin.shared.ui.grid.GridStaticSectionState getSectionState()

createRow

protected Grid.HeaderRow createRow()

removeRow

public Grid.HeaderRow removeRow(int rowIndex)
Removes the row at the given position.

Parameters:
rowIndex - the position of the row
See Also:
removeRow(StaticRow), addRowAt(int), appendRow(), prependRow()

sanityCheck

protected void sanityCheck()
                    throws java.lang.IllegalStateException
Performs a sanity check that section is in correct state.

Throws:
java.lang.IllegalStateException - if merged cells are not i n continuous range

readDesign

protected void readDesign(org.jsoup.nodes.Element tableSectionElement,
                          DesignContext designContext)
Writes the declarative design from the given table section element.

Parameters:
tableSectionElement - Element to read design from
designContext - the design context

setVisible

public void setVisible(boolean visible)
Sets the visibility of the whole section.

Parameters:
visible - true to show this section, false to hide

isVisible

public boolean isVisible()
Returns the visibility of this section.

Returns:
true if visible, false otherwise.

removeRow

public void removeRow(ROWTYPE row)
Removes the given row from the section.

Parameters:
row - the row to be removed
Throws:
java.lang.IllegalArgumentException - if the row does not exist in this section
See Also:
removeRow(int), addRowAt(int), appendRow(), prependRow()

getRow

public ROWTYPE getRow(int rowIndex)
Gets row at given index.

Parameters:
rowIndex - 0 based index for row. Counted from top to bottom
Returns:
row at given index

prependRow

public ROWTYPE prependRow()
Adds a new row at the top of this section.

Returns:
the new row
See Also:
appendRow(), addRowAt(int), removeRow(StaticRow), removeRow(int)

appendRow

public ROWTYPE appendRow()
Adds a new row at the bottom of this section.

Returns:
the new row
See Also:
prependRow(), addRowAt(int), removeRow(StaticRow), removeRow(int)

addRowAt

public ROWTYPE addRowAt(int index)
Inserts a new row at the given position.

Parameters:
index - the position at which to insert the row
Returns:
the new row
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds
See Also:
appendRow(), prependRow(), removeRow(StaticRow), removeRow(int)

getRowCount

public int getRowCount()
Gets the amount of rows in this section.

Returns:
row count

markAsDirty

protected void markAsDirty()
Informs the grid that state has changed and it should be redrawn.


removeColumn

protected void removeColumn(java.lang.Object propertyId)
Removes a column for given property id from the section.

Parameters:
propertyId - property to be removed

addColumn

protected void addColumn(java.lang.Object propertyId)
Adds a column for given property id to the section.

Parameters:
propertyId - property to be added

writeDesign

protected void writeDesign(org.jsoup.nodes.Element tableSectionElement,
                           DesignContext designContext)
Writes the declarative design to the given table section element.

Parameters:
tableSectionElement - Element to write design to
designContext - the design context
Since:
7.5.0


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