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
-
DEFAULT_ALIGNMENT
- Default alignment (Alignment.LEFT).
-
ListboxColumn()
- Default constructer.
-
ListboxColumn(Component, TableModel, int, ListboxCaption)
- Constructs a brand new ListboxColumn.
-
getAlignment()
- Gets the current alignment for this column.
-
getBackground()
- Gets the current background color.
-
getForeground()
- Gets the current foreground color for this column.
-
getLabel()
- Get the current label.
-
getSorter()
- Gets the current sorter for this column.
-
getState()
- Gets the current state of the column.
-
getWidth()
- Gets the current width.
-
isResizable()
- Determines if this column is resizable by the user.
-
isSelected()
- Determines if this column is currently selected.
-
isSortable()
- Determine if this column is sortable.
-
isVisible()
- Determines if this column is currently being shown.
-
setAlignment(Alignment)
- The alignment can be set to left, center, or right
justification.
-
setBackground(Color)
- Sets the background color.
-
setForeground(Color)
- Sets the foreground color.
-
setLabel(Object)
- Change the label displayed in the caption bar.
-
setResizable(boolean)
- Set whether this column is resizable.
-
setSorter(Sorter)
- Sets the sorter for this column.
-
setState(boolean)
- Set the state of this column.
-
setVisible(boolean)
- Shows or hides the column.
-
setWidth(int)
- Set the width of this column.
-
toString()
- Returns a text description of the settings of this ListboxColumn
instance.
DEFAULT_ALIGNMENT
public static final Alignment DEFAULT_ALIGNMENT
- Default alignment (Alignment.LEFT).
ListboxColumn
public ListboxColumn()
- Default constructer.
ListboxColumn
public ListboxColumn(Component parent,
TableModel table,
int column,
ListboxCaption caption)
- Constructs a brand new ListboxColumn.
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
getLabel
public Object getLabel()
- Get the current label.
- Returns:
- Returns the current label of this column.
- See Also:
- setLabel
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
isResizable
public boolean isResizable()
- Determines if this column is resizable by the user.
- Returns:
- Returns true if column is resizable.
- See Also:
- setResizable
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
getWidth
public int getWidth()
- Gets the current width.
- Returns:
- Returns the width, in pixels, of this column.
- See Also:
- setWidth
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
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
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
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
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
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
getAlignment
public Alignment getAlignment()
- Gets the current alignment for this column.
- Returns:
- Returns the current alignment.
- See Also:
- setAlignment
setVisible
public void setVisible(boolean visible)
- Shows or hides the column.
- Parameters:
- visible - True to show, false to hide.
- See Also:
- isVisible
isVisible
public boolean isVisible()
- Determines if this column is currently being shown.
- See Also:
- setVisible
isSelected
public boolean isSelected()
- Determines if this column is currently selected.
- Returns:
- Returns true if column is selected.
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
getBackground
public Color getBackground()
- Gets the current background color.
- Returns:
- Returns the current background color.
- See Also:
- setBackground
setForeground
public void setForeground(Color color)
- Sets the foreground color.
- Parameters:
- color - The new foreground color.
- See Also:
- getForeground, setBackground
getForeground
public Color getForeground()
- Gets the current foreground color for this column.
- Returns:
- Returns the current foreground color.
- See Also:
- setForeground
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