org.apache.pivot.wtk
Class TableView.Column

java.lang.Object
  extended by org.apache.pivot.wtk.TableView.Column
Enclosing class:
TableView

@DefaultProperty(value="cellRenderer")
public static class TableView.Column
extends Object

Contains information about a table column.


Field Summary
static int DEFAULT_WIDTH
          Default column width.
 
Constructor Summary
TableView.Column()
          Creates an empty column.
TableView.Column(String name)
          Creates a new column with no header data and a fixed default width.
TableView.Column(String name, Object headerData)
          Creates a new column with a fixed default width.
TableView.Column(String name, Object headerData, int width)
          Creates a new column with a fixed width.
TableView.Column(String name, Object headerData, int width, boolean relative)
          Creates a new column.
 
Method Summary
 TableView.CellRenderer getCellRenderer()
          Returns the column's cell renderer.
 Object getFilter()
          Returns the column's filter.
 Object getHeaderData()
          Returns the column header data.
 TableView.HeaderDataRenderer getHeaderDataRenderer()
          Returns the column header data renderer.
 int getMaximumWidth()
          Get the maximum width the column is allowed to be.
 int getMinimumWidth()
          Gets the minimum width the column is allowed to be.
 String getName()
          Returns the column name.
 TableView getTableView()
          Returns the table view with which this column is associated.
 int getWidth()
          Returns the column width.
 Limits getWidthLimits()
          Gets the minimum and maximum widths to which the column can size.
 boolean isRelative()
          Returns the relative flag.
 void setCellRenderer(TableView.CellRenderer cellRenderer)
          Sets the column's cell renderer.
 void setFilter(Object filter)
          Sets the column's filter.
 void setHeaderData(Object headerData)
          Sets the column header data.
 void setHeaderDataRenderer(TableView.HeaderDataRenderer headerDataRenderer)
          Sets the column header data renderer.
 void setMaximumWidth(int maximumWidth)
          Set the maximum width the column is allowed to be.
 void setMinimumWidth(int minimumWidth)
          Sets the minimum width the column is allowed to be.
 void setName(String name)
          Sets the column name.
 void setWidth(int width)
          Set the column width.
 void setWidth(int width, boolean relative)
          Sets the column width.
 void setWidth(String width)
          Set the column width.
 void setWidthLimits(int minimumWidth, int maximumWidth)
          Sets the minimum and maximum widths the column can size to.
 void setWidthLimits(Limits widthLimits)
          Sets the minimum and maximum widths to which the column can size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WIDTH

public static final int DEFAULT_WIDTH
Default column width.

See Also:
Constant Field Values
Constructor Detail

TableView.Column

public TableView.Column()
Creates an empty column.


TableView.Column

public TableView.Column(String name)
Creates a new column with no header data and a fixed default width.

Parameters:
name - The column name.

TableView.Column

public TableView.Column(String name,
                        Object headerData)
Creates a new column with a fixed default width.

Parameters:
name - The column name.
headerData - The column header data.

TableView.Column

public TableView.Column(String name,
                        Object headerData,
                        int width)
Creates a new column with a fixed width.

Parameters:
name - The column name.
headerData - The column header data.
width - The width of the column.

TableView.Column

public TableView.Column(String name,
                        Object headerData,
                        int width,
                        boolean relative)
Creates a new column.

Parameters:
name - The column name.
headerData - The column header data.
width - The width of the column.
relative - If true, specifies a relative column width; otherwise, specifies a fixed column width.
Method Detail

getTableView

public TableView getTableView()
Returns the table view with which this column is associated.

Returns:
The column's table view, or null if the column does not currently belong to a table.

getName

public String getName()
Returns the column name.

Returns:
The column name.

setName

public void setName(String name)
Sets the column name.

Parameters:
name - The column name.

getHeaderData

public Object getHeaderData()
Returns the column header data.

Returns:
The column header data, or null if the column has no header data.

setHeaderData

public void setHeaderData(Object headerData)
Sets the column header data.

Parameters:
headerData - The column header data, or null for no header data.

getHeaderDataRenderer

public TableView.HeaderDataRenderer getHeaderDataRenderer()
Returns the column header data renderer.


setHeaderDataRenderer

public void setHeaderDataRenderer(TableView.HeaderDataRenderer headerDataRenderer)
Sets the column header data renderer.

Parameters:
headerDataRenderer -

getWidth

public int getWidth()
Returns the column width.

Returns:
The width of the column.

isRelative

public boolean isRelative()
Returns the relative flag.

Returns:
true if the column width is relative, false if it is fixed.

setWidth

public void setWidth(int width)
Set the column width.

Parameters:
width - The absolute width of the column.

setWidth

public void setWidth(String width)
Set the column width.

Parameters:
width - The encoded width of the row. If the string ends with the '*' character, it is treated as a relative value. Otherwise, it is considered an absolute value.

setWidth

public void setWidth(int width,
                     boolean relative)
Sets the column width.

Parameters:
width - The width of the column.
relative - true if the column width is relative, false if it is fixed.

getWidthLimits

public Limits getWidthLimits()
Gets the minimum and maximum widths to which the column can size.


setWidthLimits

public void setWidthLimits(int minimumWidth,
                           int maximumWidth)
Sets the minimum and maximum widths the column can size to.

Parameters:
minimumWidth - Column width cannot be smaller than this size.
maximumWidth - Column width cannot be greater than this size.

setWidthLimits

public void setWidthLimits(Limits widthLimits)
Sets the minimum and maximum widths to which the column can size.

Parameters:
widthLimits - The new width limits.

getMinimumWidth

public int getMinimumWidth()
Gets the minimum width the column is allowed to be.

Returns:
Minimum column width.

setMinimumWidth

public void setMinimumWidth(int minimumWidth)
Sets the minimum width the column is allowed to be.

Parameters:
minimumWidth - Minimum column width.

getMaximumWidth

public int getMaximumWidth()
Get the maximum width the column is allowed to be.

Returns:
Maximum column width.

setMaximumWidth

public void setMaximumWidth(int maximumWidth)
Set the maximum width the column is allowed to be.

Parameters:
maximumWidth - Maximum column width.

getFilter

public Object getFilter()
Returns the column's filter.

Returns:
The column's filter, or null if the column does not have a filter.

setFilter

public void setFilter(Object filter)
Sets the column's filter.

Parameters:
filter - The column's filter, or null for no filter.

getCellRenderer

public TableView.CellRenderer getCellRenderer()
Returns the column's cell renderer.

Returns:
The cell renderer that is used to draw the contents of this column.

setCellRenderer

public void setCellRenderer(TableView.CellRenderer cellRenderer)
Sets the column's cell renderer.

Parameters:
cellRenderer - The cell renderer that is used to draw the contents of this column.