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.
- See Also:
- getColumnInfo
-
caption
-
-
CENTER
- Align in center.
Deprecated.
-
DEFAULT_ALIGNMENT
- Default alignment (LEFT).
-
LEFT
- Align to left.
Deprecated.
-
RIGHT
- Align to right.
Deprecated.
-
ListboxColumn()
- Default constructer.
-
ListboxColumn(MultiColumnListbox, CaptionBar, Caption)
- Constructs a brand new ListboxColumn.
-
addElement(Object)
- Adds an element to this column.
-
elementAt(int)
- Returns the element at the specified index.
-
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.
-
insertElementAt(Object, int)
- Inserts the element at the specified index.
-
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.
-
removeAllElements()
- Removes all of the elements in this column.
-
removeElementAt(int)
- Removes the element at the specified index.
-
setAlignment(Alignment)
-
-
setAlignment(int)
- Sets the text alignment of the elements in this column.
Deprecated.
-
setBackground(Color)
- Sets the background color.
-
setElementAt(Object, int)
- Sets the element at the specified index.
-
setForeground(Color)
- Sets the foreground color.
-
setLabel(String)
- 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.
-
size()
- Determine number of elements in this column.
-
toString()
- Returns a text description of the settings of this ListboxColumn
instance.
LEFT
public static final int LEFT
- Note: LEFT is deprecated.
Use Alignment.LEFT
- Align to left.
CENTER
public static final int CENTER
- Note: CENTER is deprecated.
Use Alignment.CENTER
- Align in center.
RIGHT
public static final int RIGHT
- Note: RIGHT is deprecated.
Use Alignment.RIGHT
- Align to right.
DEFAULT_ALIGNMENT
public static final Alignment DEFAULT_ALIGNMENT
- Default alignment (LEFT).
caption
protected Caption caption
ListboxColumn
public ListboxColumn()
- Default constructer.
ListboxColumn
public ListboxColumn(MultiColumnListbox parent,
CaptionBar bar,
Caption caption)
- Constructs a brand new ListboxColumn.
setLabel
public void setLabel(String label)
- Change the label displayed in the caption bar.
- Parameters:
- label - The new label for this column.
- See Also:
- getLabel
getLabel
public String 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(int alignment)
- Note: setAlignment() is deprecated.
Use setAlignment(Alignment)
- Sets the text alignment of the elements in this column.
setAlignment
public void setAlignment(Alignment 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
size
public int size()
- Determine number of elements in this column.
- Returns:
- Returns the number of elements.
addElement
protected void addElement(Object element)
- Adds an element to this column. This function is only to
be called by MultiColumnListbox.
- Parameters:
- element - The element to add.
- See Also:
- elementAt, removeElementAt
removeElementAt
protected void removeElementAt(int index)
- Removes the element at the specified index.
setElementAt
public void setElementAt(Object element,
int index)
- Sets the element at the specified index.
- Parameters:
- element - The new element.
- index - Where to replace the element.
insertElementAt
public void insertElementAt(Object element,
int index)
- Inserts the element at the specified index.
- Parameters:
- element - The new element.
- index - Where to insert the element.
removeAllElements
protected void removeAllElements()
- Removes all of the elements in this column.
elementAt
public Object elementAt(int index)
- Returns the element at the specified index.
- Parameters:
- index - Which element to return.
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