org.springframework.richclient.widget.table
Class PropertyColumn

Show UML class diagram
java.lang.Object
  extended by org.springframework.richclient.widget.table.PropertyColumn

public class PropertyColumn
extends Object

A column descriptor to access a specific property. Minimal configuration includes the propertyName and an Accessor. Other features can be set using the normal bean setters and getters or through a number of chaining methods. The latter is particularly useful to create columns by instantiating the column with the minimum requirements and then adding all settings in one go.

Since:
0.5.0
Author:
Jan Hoskens

Field Summary
static int UNSPECIFIED_WIDTH
          No specific width set.
 
Constructor Summary
PropertyColumn(Class<?> type, Accessor accessor, String propertyName, String[] headerKeys, int minWidth, int maxWidth, boolean resizable, TableCellRenderer renderer, TableCellEditor editor, Comparator<?> comparator, boolean isSelectColumn, boolean visible)
          Deprecated. Please use the other system (minimal constructor + adding necessary elements)
PropertyColumn(String propertyName)
           
PropertyColumn(String propertyName, Accessor accessor, Class<?> propertyType)
          Minimal construction requires a propertyName and an Accessor.
 
Method Summary
 Accessor getAccessor()
           
 Comparator<?> getComparator()
           
 TableCellEditor getEditor()
           
 String getHeader()
          Returns the header to be used as column title.
 String[] getHeaderKeys()
          Returns the header keys that are used to fetch the column title if the header property is not set.
 int getMaxWidth()
          Returns the maximum width for this column.
 int getMinWidth()
          Returns the minimum width for this column.
 String getPropertyName()
           
 TableCellRenderer getRenderer()
           
 Class<?> getType()
           
 boolean isFilterColumn()
           
 boolean isResizable()
           
 boolean isSelectColumn()
           
 boolean isVisible()
           
 void setAccessor(Accessor accessor)
          Set the accessor to use when retrieving the property value.
 void setComparator(Comparator<?> comparator)
           
 void setEditor(TableCellEditor editor)
           
 void setFilterColumn(boolean isFilterColumn)
           
 void setHeader(String header)
           
 void setHeaderKeys(String[] headerKeys)
          Set the keys used to fetch the column title from the resources if no header is explicitly set.
 void setMaxWidth(int maxWidth)
          Set the maximum width of this column.
 void setMinWidth(int minWidth)
          Set the minimum width for this column.
 void setRenderer(TableCellRenderer renderer)
           
 void setResizable(boolean resizable)
           
 void setSelectColumn(boolean isSelectColumn)
           
 void setType(Class<?> type)
          The type of the property.
 void setVisible(boolean visible)
           
 PropertyColumn withComparator(Comparator<?> comparator)
           
 PropertyColumn withEditor(AbstractDataEditorWidget dataEditor)
           
 PropertyColumn withEditor(BindingFactory bindingFactory)
           
 PropertyColumn withEditor(FormModel formModel)
           
 PropertyColumn withEditor(TableCellEditor editor)
           
 PropertyColumn withFilterColumn(boolean isFilterColumn)
           
 PropertyColumn withFixedWidth(int width)
          Chaining method to set the minimum and maximum width to the same value.
 PropertyColumn withHeaderKeys(String[] headerKeys)
          Chaining method to set header keys.
 PropertyColumn withMaxWidth(int maxWidth)
          Chaining method to set the maximum width.
 PropertyColumn withMinWidth(int minWidth)
          Chaining method to set the minimum width.
 PropertyColumn withRenderer(TableCellRenderer renderer)
           
 PropertyColumn withResizable(boolean resizable)
           
 PropertyColumn withSelectColumn(boolean isSelectColumn)
           
 PropertyColumn withVisible(boolean visible)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNSPECIFIED_WIDTH

public static final int UNSPECIFIED_WIDTH
No specific width set.

See Also:
Constant Field Values
Constructor Detail

PropertyColumn

public PropertyColumn(String propertyName)

PropertyColumn

public PropertyColumn(String propertyName,
                      Accessor accessor,
                      Class<?> propertyType)
Minimal construction requires a propertyName and an Accessor.

Parameters:
propertyName - name of the property.
accessor - read-access for the property.

PropertyColumn

public PropertyColumn(Class<?> type,
                      Accessor accessor,
                      String propertyName,
                      String[] headerKeys,
                      int minWidth,
                      int maxWidth,
                      boolean resizable,
                      TableCellRenderer renderer,
                      TableCellEditor editor,
                      Comparator<?> comparator,
                      boolean isSelectColumn,
                      boolean visible)
Deprecated. Please use the other system (minimal constructor + adding necessary elements)

Constructor taking all possible arguments.

Method Detail

setAccessor

public void setAccessor(Accessor accessor)
Set the accessor to use when retrieving the property value.

Parameters:
accessor - the Accessor to read the property value.

setType

public void setType(Class<?> type)
The type of the property.

Parameters:
type - the type of the property.

getHeader

public String getHeader()
Returns the header to be used as column title. If no explicit header was set, the headerKeys are used to fetch a message from the available resources.


getHeaderKeys

public String[] getHeaderKeys()
Returns the header keys that are used to fetch the column title if the header property is not set.


withHeaderKeys

public PropertyColumn withHeaderKeys(String[] headerKeys)
Chaining method to set header keys.

Parameters:
headerKeys - keys used to fetch the column title from the resources if no header is explicitly set.
Returns:
this

setHeaderKeys

public void setHeaderKeys(String[] headerKeys)
Set the keys used to fetch the column title from the resources if no header is explicitly set.


getMaxWidth

public int getMaxWidth()
Returns the maximum width for this column.


withMaxWidth

public PropertyColumn withMaxWidth(int maxWidth)
Chaining method to set the maximum width.

Parameters:
maxWidth - maximum width for this column
Returns:
this

setMaxWidth

public void setMaxWidth(int maxWidth)
Set the maximum width of this column.


getMinWidth

public int getMinWidth()
Returns the minimum width for this column.


withMinWidth

public PropertyColumn withMinWidth(int minWidth)
Chaining method to set the minimum width.

Parameters:
minWidth - minimum width for this column
Returns:
this

setMinWidth

public void setMinWidth(int minWidth)
Set the minimum width for this column.


withFixedWidth

public PropertyColumn withFixedWidth(int width)
Chaining method to set the minimum and maximum width to the same value. This will create a fixed width column.

Parameters:
width - fixed width for this column
Returns:
this

isResizable

public boolean isResizable()

withResizable

public PropertyColumn withResizable(boolean resizable)

setResizable

public void setResizable(boolean resizable)

withFilterColumn

public PropertyColumn withFilterColumn(boolean isFilterColumn)

setFilterColumn

public void setFilterColumn(boolean isFilterColumn)

isFilterColumn

public boolean isFilterColumn()

getRenderer

public TableCellRenderer getRenderer()

withRenderer

public PropertyColumn withRenderer(TableCellRenderer renderer)

setRenderer

public void setRenderer(TableCellRenderer renderer)

getEditor

public TableCellEditor getEditor()

withEditor

public PropertyColumn withEditor(TableCellEditor editor)

withEditor

public PropertyColumn withEditor(BindingFactory bindingFactory)

withEditor

public PropertyColumn withEditor(FormModel formModel)

withEditor

public PropertyColumn withEditor(AbstractDataEditorWidget dataEditor)

setEditor

public void setEditor(TableCellEditor editor)

getComparator

public Comparator<?> getComparator()

withComparator

public PropertyColumn withComparator(Comparator<?> comparator)

setComparator

public void setComparator(Comparator<?> comparator)

withSelectColumn

public PropertyColumn withSelectColumn(boolean isSelectColumn)

isSelectColumn

public boolean isSelectColumn()

setSelectColumn

public void setSelectColumn(boolean isSelectColumn)

isVisible

public boolean isVisible()

withVisible

public PropertyColumn withVisible(boolean visible)

setVisible

public void setVisible(boolean visible)

getType

public Class<?> getType()

getAccessor

public Accessor getAccessor()

getPropertyName

public String getPropertyName()

setHeader

public void setHeader(String header)


Copyright © 2004-2009 The Spring Framework. All Rights Reserved.