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

Variable Index

 o caption
 o CENTER
Align in center. Deprecated.
 o DEFAULT_ALIGNMENT
Default alignment (LEFT).
 o LEFT
Align to left. Deprecated.
 o RIGHT
Align to right. Deprecated.

Constructor Index

 o ListboxColumn()
Default constructer.
 o ListboxColumn(MultiColumnListbox, CaptionBar, Caption)
Constructs a brand new ListboxColumn.

Method Index

 o addElement(Object)
Adds an element to this column.
 o elementAt(int)
Returns the element at the specified 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 insertElementAt(Object, int)
Inserts the element at the specified index.
 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 removeAllElements()
Removes all of the elements in this column.
 o removeElementAt(int)
Removes the element at the specified index.
 o setAlignment(Alignment)
 o setAlignment(int)
Sets the text alignment of the elements in this column. Deprecated.
 o setBackground(Color)
Sets the background color.
 o setElementAt(Object, int)
Sets the element at the specified index.
 o setForeground(Color)
Sets the foreground color.
 o setLabel(String)
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 size()
Determine number of elements in this column.
 o toString()
Returns a text description of the settings of this ListboxColumn instance.

Variables

 o LEFT
 public static final int LEFT
Note: LEFT is deprecated. Use Alignment.LEFT

Align to left.

 o CENTER
 public static final int CENTER
Note: CENTER is deprecated. Use Alignment.CENTER

Align in center.

 o RIGHT
 public static final int RIGHT
Note: RIGHT is deprecated. Use Alignment.RIGHT

Align to right.

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

 o caption
 protected Caption caption

Constructors

 o ListboxColumn
 public ListboxColumn()
Default constructer.

 o ListboxColumn
 public ListboxColumn(MultiColumnListbox parent,
                      CaptionBar bar,
                      Caption caption)
Constructs a brand new ListboxColumn.

Methods

 o 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
 o getLabel
 public String 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(int alignment)
Note: setAlignment() is deprecated. Use setAlignment(Alignment)

Sets the text alignment of the elements in this column.

 o setAlignment
 public void setAlignment(Alignment 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 size
 public int size()
Determine number of elements in this column.

Returns:
Returns the number of elements.
 o 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
 o removeElementAt
 protected void removeElementAt(int index)
Removes the element at the specified index.

 o 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.
 o 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.
 o removeAllElements
 protected void removeAllElements()
Removes all of the elements in this column.

 o elementAt
 public Object elementAt(int index)
Returns the element at the specified index.

Parameters:
index - Which element to return.
 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