de.twenty11.skysail.common.grids
Class ColumnDefinition

java.lang.Object
  extended by de.twenty11.skysail.common.grids.ColumnDefinition
All Implemented Interfaces:
Serializable

public class ColumnDefinition
extends Object
implements Serializable

Defines a grid column. A grid column has a name, a filter (maybe empty), a "sorting" field (defaults to 0), and a width (defaults to null). Columns can be "chained" together using a ColumnsBuilder in a DSL-style fashion. The column definitions can be used to compose a grid out of its defining columns and to display it (with proper filtering, sorting and width).

Author:
carsten
See Also:
Serialized Form

Constructor Summary
ColumnDefinition()
          default constructor needed for json / jackson de-/serialization.
ColumnDefinition(String columnName)
          constructor with name for the column definition.
 
Method Summary
 void apply()
           
 boolean equals(Object obj)
           
 String getFilterValue()
          returns the filter value.
 String getName()
          returns the name.
 Integer getSorting()
          returns the sorting.
 Integer getWidth()
           
 int hashCode()
           
 void setFilterValue(String filter)
          needed for jackson.
 void setName(String theName)
          needed for jackson.
 void setSorting(Integer theSorting)
          needed for jackson.
 ColumnDefinition setWidth(Integer colWidth)
           
 ColumnDefinition sortAsc(Integer weight)
           
 ColumnDefinition sortDesc(Integer weight)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColumnDefinition

public ColumnDefinition()
default constructor needed for json / jackson de-/serialization.


ColumnDefinition

public ColumnDefinition(String columnName)
constructor with name for the column definition.

Parameters:
columnName - for the column
Method Detail

apply

public final void apply()

sortDesc

public final ColumnDefinition sortDesc(Integer weight)
Parameters:
weight - value used for deciding about precedence
Returns:
"this" to be used in DSL-style.

sortAsc

public final ColumnDefinition sortAsc(Integer weight)
Parameters:
weight - value used for deciding about precedence
Returns:
"this" to be used in DSL-style.

setWidth

public final ColumnDefinition setWidth(Integer colWidth)
Parameters:
colWidth - in pixel
Returns:
"this" to be used in DSL-style.

getWidth

public final Integer getWidth()
Returns:
the width of this column.

getFilterValue

public final String getFilterValue()
returns the filter value.

Returns:
a string filter representation

setFilterValue

public void setFilterValue(String filter)
needed for jackson.


setName

public void setName(String theName)
needed for jackson.


getName

public final String getName()
returns the name.

Returns:
the name

getSorting

public final Integer getSorting()
returns the sorting.

Returns:
the sorting

setSorting

public void setSorting(Integer theSorting)
needed for jackson.


toString

public final String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2011-2012. All Rights Reserved.