|
java-gnome version 4.0.7 | ||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
public static interface TreeView.ROW_ACTIVATED
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 is pressed while a row is
selected.
In general, you've got the TreeModel and especially its DataColumns
visible, so to use ROW_ACTIVATED you can just:
final TreeModel model;
final DataColumnString column;
view.connect(new TreeView.ROW_ACTIVATED() {
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.
ROW_ACTIVATED is perfectly sufficient for basic
situations, but you may need to see TreeSelection's
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 | ||||