All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.taligent.widget.ListboxColumn

java.lang.Object
   |
   +----COM.taligent.widget.ListboxColumn

public class ListboxColumn
extends Object
implements Serializable
A column object used by the MultiColumnListbox class. Column data and attributes specific to a column are stored here. When using the MultiColumnListbox, you can query and set column information (e.g. width, label, color) through ListboxColumn methods.

Version:
1.1
Author:
Andy Clark, Taligent Inc.
See Also:
getColumnInfo

Variable Index

 o DEFAULT_ALIGNMENT
Default alignment (Alignment.LEFT).

Constructor Index

 o ListboxColumn()
Default constructer.
 o ListboxColumn(Component, TableModel, int, ListboxCaption)
Constructs a brand new ListboxColumn.

Method Index

 o getAlignment()
Gets the current alignment for this column.
 o getBackground()
Gets the current background color.
 o getForeground()
Gets the current foreground color for this column.
 o getLabel()
Get the current label.
 o getSorter()
Gets the current sorter for this column.
 o getState()
Gets the current state of the column.
 o getWidth()
Gets the current width.
 o isResizable()
Determines if this column is resizable by the user.
 o isSelected()
Determines if this column is currently selected.
 o isSortable()
Determine if this column is sortable.
 o isVisible()
Determines if this column is currently being shown.
 o setAlignment(Alignment)
The alignment can be set to left, center, or right justification.
 o setBackground(Color)
Sets the background color.
 o setForeground(Color)
Sets the foreground color.
 o setLabel(Object)
Change the label displayed in the caption bar.
 o setResizable(boolean)
Set whether this column is resizable.
 o setSorter(Sorter)
Sets the sorter for this column.
 o setState(boolean)
Set the state of this column.
 o setVisible(boolean)
Shows or hides the column.
 o setWidth(int)
Set the width of this column.
 o toString()
Returns a text description of the settings of this ListboxColumn instance.

Variables

 o DEFAULT_ALIGNMENT
 public static final Alignment DEFAULT_ALIGNMENT
Default alignment (Alignment.LEFT).

Constructors

 o ListboxColumn
 public ListboxColumn()
Default constructer.

 o ListboxColumn
 public ListboxColumn(Component parent,
                      TableModel table,
                      int column,
                      ListboxCaption caption)
Constructs a brand new ListboxColumn.

Methods

 o setLabel
 public void setLabel(Object label)
Change the label displayed in the caption bar.

Parameters:
label - The new label for this column.
See Also:
getLabel
 o getLabel
 public Object getLabel()
Get the current label.

Returns:
Returns the current label of this column.
See Also:
setLabel
 o setResizable
 public void setResizable(boolean resizable)
Set whether this column is resizable.

Parameters:
resizable - Is true to make the column resizable by the user and false if the user is not allowed to resize the column.
See Also:
isResizable
 o isResizable
 public boolean isResizable()
Determines if this column is resizable by the user.

Returns:
Returns true if column is resizable.
See Also:
setResizable
 o setWidth
 public void setWidth(int width)
Set the width of this column.

Parameters:
width - The new width of the column, in pixels.
See Also:
getWidth
 o getWidth
 public int getWidth()
Gets the current width.

Returns:
Returns the width, in pixels, of this column.
See Also:
setWidth
 o setSorter
 public void setSorter(Sorter sorter)
Sets the sorter for this column. By default, a column is NOT sortable. For example, if you want to sort the column alphabetically, you could do the following: column.setSorter(new COM.taligent.util.AlphabeticSelectionSorter()); to do an alphabetic sort of the column using Selection Sort. To make a column NOT sortable, pass 'null' to setSorter.

Parameters:
sorter - The new sorter for this column, or null to turn off sorting for this column.
See Also:
getSorter, isSortable
 o getSorter
 public Sorter getSorter()
Gets the current sorter for this column.

Returns:
s Returns a reference to the column's sorter, or null if no sorter has been set.
See Also:
setSorter, isSortable
 o isSortable
 public boolean isSortable()
Determine if this column is sortable. Use setSorter() to turn sorting on and off and to specify specific sorting algorithms.

Returns:
Returns true if column is sortable.
See Also:
setSorter, getSorter
 o setState
 protected void setState(boolean state)
Set the state of this column. The state of this column is either true or false and determines the look of a column caption. This attribute is only important when the column is sortable. The caption for this column uses the state information to determine whether it should display an upside down or rightside up triangle next to the caption text. The programmer does NOT need to call this function because it is used internally by the MultiColumnListbox class.

Parameters:
state - The new state for this column.
See Also:
getState
 o getState
 protected boolean getState()
Gets the current state of the column. The programmer does NOT need to invoke this method.

Returns:
Returns the state of this column.
See Also:
setState
 o setAlignment
 public void setAlignment(Alignment alignment)
The alignment can be set to left, center, or right justification.

Parameters:
alignment - The new alignment for this column.
See Also:
getAlignment, LEFT, CENTER, RIGHT, DEFAULT_ALIGNMENT
 o getAlignment
 public Alignment getAlignment()
Gets the current alignment for this column.

Returns:
Returns the current alignment.
See Also:
setAlignment
 o setVisible
 public void setVisible(boolean visible)
Shows or hides the column.

Parameters:
visible - True to show, false to hide.
See Also:
isVisible
 o isVisible
 public boolean isVisible()
Determines if this column is currently being shown.

See Also:
setVisible
 o isSelected
 public boolean isSelected()
Determines if this column is currently selected.

Returns:
Returns true if column is selected.
 o setBackground
 public void setBackground(Color color)
Sets the background color. By default, the background color is null; the default row background color will be used instead.

Parameters:
color - The new background color.
See Also:
getBackground, setForeground
 o getBackground
 public Color getBackground()
Gets the current background color.

Returns:
Returns the current background color.
See Also:
setBackground
 o setForeground
 public void setForeground(Color color)
Sets the foreground color.

Parameters:
color - The new foreground color.
See Also:
getForeground, setBackground
 o getForeground
 public Color getForeground()
Gets the current foreground color for this column.

Returns:
Returns the current foreground color.
See Also:
setForeground
 o toString
 public String toString()
Returns a text description of the settings of this ListboxColumn instance.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index