org.gnu.gtk
public class TreeSelection extends GObject
Deprecated: This class is part of the java-gnome 2.x family of libraries,
which, due to their inefficiency and complexity, are no longer
being maintained and have been abandoned by the java-gnome
project. This class may in the future have an equivalent in
java-gnome 4.0, try looking for
org.gnome.gtk.TreeSelection
.
You should be aware that there is a considerably different API
in the new library: the architecture is completely different
and most notably internals are no longer exposed to public view.
The TreeSelection object is gotten from a TreeView by calling 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).
Method Summary | |
---|---|
void | addListener(TreeSelectionListener listener)
Register an object to handle Selection change events which are emitted
whenever the selection has (possibly) changed
|
int | countRows()
Returns the number of rows that have been selected.
|
void | forEachSelected(TreeSelectionForEach implementor)
Calls the forEach method of the specified class for every selected value. |
Class | getEventListenerClass(String signal) |
EventType | getEventType(String signal) |
SelectionMode | getMode() |
boolean | getSelected(TreePath path)
Returns TRUE if the row pointed to by path is currently selected. |
boolean | getSelected(TreeIter iter)
Returns TRUE if the row pointed to by iter is currently selected.
|
TreePath[] | getSelectedRows()
Returns an array of rows which are currently selected
|
TreeView | getTreeView()
Returns the TreeView associated with the selection.
|
static Type | getType()
Retrieve the runtime type used by the GLib library. |
void | removeListener(TreeSelectionListener listener)
Removes a listener
|
void | select(TreePath path)
Select the row at path.
|
void | select(TreeIter iter)
Selects the specified iterator.
|
void | select(TreePath startPath, TreePath endPath)
Selects a range of nodes, determined by startPath and endPath inclusive.
|
void | selectAll()
Selects all the nodes. |
void | setMode(SelectionMode mode)
Sets the selection mode of the selection. |
void | unselect(TreePath path)
Unselects the row at path.
|
void | unselect(TreeIter iter)
Unselects the specified iterator.
|
void | unselect(TreePath startPath, TreePath endPath) |
void | unselectAll()
Unselects all the nodes. |
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) changedSee Also: TreeSelectionListener
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
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.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 returnedParameters: path A patch to check the selection on
Returns: True if the path is selected.
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.
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 selectedReturns: an empty array if there aren't any rows selected; or an array filled with TreePath objects, representing the selections.
Since: 2.2
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 TreeView associated with the selection.Returns: Associated widget
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.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 listenerSee Also: addListener
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.
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 The TreeIter to be selected.
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.
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.MULTIPLEDeprecated: 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.
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
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 The TreeIter to be unselected.
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.