Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsTreeViewer with TableLayout
https://www.eclipse.org/forums/index.php/mv/msg/169865/539549/#msg_539549
I created a TreeViewer with TableLayout. The business model just has 2 level hierarchy. And I do not display the root element. So, you just can see the second-level items and their leaves. Each element has attributes like name, path, label and so on which are displayed in the table cell. My new requirement is to add a delete icon for each second-level, putting it in the last place(or column if it is) . Then if user click I will remove this element and its children.
But I am not familiar with the UI part. I just know adding an icon is easy(getColumnImage() in the LabelProvider). But I do not know how to listener the user clicking event. Any suggestion is welcome and appreciated.
Thanks,
Ricky ]]>Ricky Ru2010-06-11T09:20:31-00:00Re: TreeViewer with TableLayout
https://www.eclipse.org/forums/index.php/mv/msg/169865/539927/#msg_539927
> Hi friends,
>
> I created a TreeViewer with TableLayout. The business model just has 2
> level hierarchy. And I do not display the root element. So, you just can
> see the second-level items and their leaves. Each element has attributes
> like name, path, label and so on which are displayed in the table cell.
> My new requirement is to add a delete icon for each second-level,
> putting it in the last place(or column if it is) . Then if user click I
> will remove this element and its children.
>
> But I am not familiar with the UI part. I just know adding an icon is
> easy(getColumnImage() in the LabelProvider). But I do not know how to
> listener the user clicking event. Any suggestion is welcome and
> appreciated.
>
> Thanks,
> Ricky
You can track user clicks by adding a mouse listener to the tree viewer.
"treeViewer.getTree().addMouseListener(...)"
A better UI design will be provide the delete option inside a context
menu (rather than as an icon). Give the user the option to delete even
using the 'DEL' key. You can track selection changes using
"treeViewer.getTree().addSelectionListener(...)"]]>Madhu Samuel2010-06-14T09:20:02-00:00Re: TreeViewer with TableLayout
https://www.eclipse.org/forums/index.php/mv/msg/169865/540702/#msg_540702
Ricky Ru2010-06-17T06:47:29-00:00