Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
GObject
org.gnu.gtk.TreeSelection
public class TreeSelection
extends GObject
TreeView
widget. The TreeSelection object is automatically created
when a newTreeView widget is created, and cannot exist independentally of
this widget. The primary reason the TreeSelection objects exists is for
cleanliness of code and API. That is, there is no conceptual reason all these
functions could not be methods on the TreeView widget instead of a separate
function.
The TreeSelection object is gotten from a TreeView by calling
TreeView.getSelection()
. It can be manipulated to check the
selection status of the tree, as well as select and deselect individual rows.
Selection is done completely view side. As a result, multiple views of the
same model can have completely different selections. Additionally, you cannot
change the selection of a row on the model that is not currently displayed by
the view without expanding its parents first.
One of the important things to remember when monitoring the selection of a
view is that the CHANGED
event is mostly a hint. That is, it may only emit one signal when a range of
rows is selected. Additionally, it may on occasion emit a "changed" event
when nothing has happened (mostly as a result of programmers calling
selectRow on an already selected row).
TreeView
Method Summary | |
void |
|
int |
|
void |
|
Class |
|
EventType |
|
SelectionMode |
|
boolean |
|
boolean |
|
TreePath[] |
|
TreeView |
|
static Type |
|
void |
|
void | |
void | |
void | |
void |
|
void |
|
void | |
void | |
void | |
void |
|
public void addListener(TreeSelectionListener listener)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Register an object to handle Selection change events which are emitted whenever the selection has (possibly) changed
- See Also:
TreeSelectionListener
public int countRows()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Returns the number of rows that have been selected.
- Since:
- 2.2
public void forEachSelected(TreeSelectionForEach implementor)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Calls the forEach method of the specified class for every selected value.
public Class getEventListenerClass(String signal)
public EventType getEventType(String signal)
public boolean getSelected(TreeIter iter)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Returns TRUE if the row pointed to by iter is currently selected.
- Parameters:
iter
- The iter to test the selection of
- Returns:
- true if the iter is selected.
public boolean getSelected(TreePath path)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Returns TRUE if the row pointed to by path is currently selected. If path does not point to a valid location, FALSE is returned
- Parameters:
path
- A patch to check the selection on
- Returns:
- True if the path is selected.
public TreePath[] getSelectedRows()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Returns an array of rows which are currently selected
- Returns:
- an empty array if there aren't any rows selected; or an array filled with TreePath objects, representing the selections.
- Since:
- 2.2
public TreeView getTreeView()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Returns theTreeView
associated with the selection.
- Returns:
- Associated widget
public static Type getType()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Retrieve the runtime type used by the GLib library.
public void removeListener(TreeSelectionListener listener)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Removes a listener
- See Also:
addListener(TreeSelectionListener)
public void select(TreeIter iter)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Selects the specified iterator.
- Parameters:
iter
- TheTreeIter
to be selected.
public void select(TreePath path)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Select the row at path.
- Parameters:
path
- The path to be selected.
public void select(TreePath startPath, TreePath endPath)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Selects a range of nodes, determined by startPath and endPath inclusive.
- Parameters:
startPath
- The initial node of the range.endPath
- The final node of the range.
public void selectAll()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Selects all the nodes. Mode must be set to SelectionMode.MULTIPLE
public void setMode(SelectionMode mode)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Sets the selection mode of the selection. If the previous type was SelectionMode.MULTIPLE, then the anchor is kept selected, if it was previously selected.
- Parameters:
mode
- The selection mode to use.
public void unselect(TreeIter iter)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Unselects the specified iterator.
- Parameters:
iter
- TheTreeIter
to be unselected.
public void unselect(TreePath path)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Unselects the row at path.
- Parameters:
path
- The path to be deselected
public void unselectAll()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Unselects all the nodes.