|
java-gnome version 4.0.19 | ||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface TreeView.RowActivated
Emitted when a row in the TreeView has been activated. Activation
occurs when a row in the view is double-clicked, or when
Space
or Enter
are pressed while a
row is selected.
In general, you've got the TreeModel and especially its DataColumns
visible, so to use TreeView.RowActivated
you can just:
final TreeModel model; final DataColumnString column; view.connect(new TreeView.RowActivated() { public void onRowActivated(TreeView source, TreePath path, TreeViewColumn vertical) { final TreeIter row; row = model.getIter(path); ... = model.getValue(row, column); } });Remember that TreeIters and TreePaths are not stable over changes to the model, so get on with using
path
right away.
TreeView.RowActivated
is perfectly sufficient for basic
situations, but you may need to see TreeSelection's
TreeSelection.Changed
to for more complicated selection and
activation expressions. In practise you'll use both.
Method Summary | |
---|---|
void |
onRowActivated(TreeView source,
TreePath path,
TreeViewColumn vertical)
The useful parameter is usually path which can be
converted into a TreeIter with your TreeModel's
getIter() allowing you to then
lookup a particular value from the data model. |
Method Detail |
---|
void onRowActivated(TreeView source, TreePath path, TreeViewColumn vertical)
path
which can be
converted into a TreeIter with your TreeModel's
getIter()
allowing you to then
lookup a particular value from the data model. You rarely need
vertical
but it can give you some indication in which
column the click happened.
|
![]() java-gnome |
||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |