All Packages Class Hierarchy This Package Previous Next Index
Class com.trumphurst.controls.TRowDocument
java.lang.Object
|
+----com.trumphurst.controls.TDocument
|
+----com.trumphurst.controls.TRowDocument
- public class TRowDocument
- extends TDocument
- implements ItemSelectable
A document which contains a list of objects, each representing a row,
such as would be displayed in a scrolling list.
Allows one object in the list to be "selected".
- See Also:
- TMultiColumnList, TTreeListDocument
-
actionListener
- Event Multicaster
-
itemListener
- Event Multicaster
-
list
- The list of objects.
-
TRowDocument(String)
-
-
action(int)
- The given row has been actioned (double-clicked or <cr> has been pressed).
-
addActionListener(ActionListener)
- Add a Listener for when selected item is double-clicked.
-
addElement(Object)
- Add an object to the list at the end.
-
addElement(Object, int)
- Add an object to the list at the specified row.
-
addItemListener(ItemListener)
- ItemSelectable - add a Listener for when selected item changes.
-
clear()
- Remove all items from the list.
-
delElement(int)
- Remove one object from the list.
-
delElements(int, int)
- Remove multiple objects from the list.
-
elementAt(int)
- Returns the object at a given row.
-
getSelectedIndex()
- Find which row is selected.
-
getSelectedObject()
- Find which object is selected.
-
getSelectedObjects()
- ItemSelectable - return selected Objects (there is only one).
-
indexOf(Object)
- Returns the row of a given object, or -1 if not found.
-
removeActionListener(ActionListener)
- Remove a Listener.
-
removeItemListener(ItemListener)
- ItemSelectable - remove a Listener.
-
select(int)
- Select the given row.
-
size()
- Returns the number of rows in the list.
itemListener
protected ItemListener itemListener
- Event Multicaster
actionListener
protected ActionListener actionListener
- Event Multicaster
list
protected Vector list
- The list of objects.
TRowDocument
public TRowDocument(String name)
size
public int size()
- Returns the number of rows in the list.
addElement
public synchronized void addElement(Object item,
int index)
- Add an object to the list at the specified row.
- Parameters:
- item - The object to add.
- index - Where to add the object (-1 = at end).
addElement
public void addElement(Object item)
- Add an object to the list at the end.
- Parameters:
- item - The object to add.
elementAt
public synchronized Object elementAt(int index)
- Returns the object at a given row.
- Parameters:
- index - The row to get.
- Returns:
- The object at that row, or null if index out of range
indexOf
public synchronized int indexOf(Object o)
- Returns the row of a given object, or -1 if not found.
- Parameters:
- o - The object to find.
- Returns:
- The row number, or -1 if object not in document
delElement
public void delElement(int index)
- Remove one object from the list.
- Parameters:
- index - The row number to remove.
delElements
public synchronized void delElements(int start,
int end)
- Remove multiple objects from the list.
- Parameters:
- start - The first row to remove.
- end - Tthe last row to remove.
clear
public void clear()
- Remove all items from the list.
getSelectedIndex
public int getSelectedIndex()
- Find which row is selected.
- Returns:
- The selected row, or -1 if none selected.
getSelectedObject
public Object getSelectedObject()
- Find which object is selected.
- Returns:
- The object at the selected row, or null if none selected.
select
public synchronized void select(int row)
- Select the given row.
- Parameters:
- row - The row to select. Must be in range, or -1 to deselect.
action
public void action(int row)
- The given row has been actioned (double-clicked or <cr> has been pressed).
Normally overridden in subclasses.
- Parameters:
- row - The row actioned.
getSelectedObjects
public Object[] getSelectedObjects()
- ItemSelectable - return selected Objects (there is only one).
addItemListener
public void addItemListener(ItemListener l)
- ItemSelectable - add a Listener for when selected item changes.
removeItemListener
public void removeItemListener(ItemListener l)
- ItemSelectable - remove a Listener.
addActionListener
public void addActionListener(ActionListener l)
- Add a Listener for when selected item is double-clicked.
removeActionListener
public void removeActionListener(ActionListener l)
- Remove a Listener.
All Packages Class Hierarchy This Package Previous Next Index