mouse over clickable region in TableTreeViewer [message #447405] |
Tue, 14 December 2004 06:47  |
Eclipse User |
|
|
|
Dear all,
I have a single column TableTreeViewer (i.e. basically a tree but need to Table lines as may be adding columns in the future). I want to be able able to display a plus "+" icon against each TableTreeItem when I mouse over it if it has actions associated with the item. Single clicking on the plus should display a popup dialog (already in place, currently I display the popup on double click events on the TableTreeViewer). I would like the icon to appear on the left hand side of the TableTreeItem or alternatively as an overlay/floating icon above the TableTreeItem text.
To summarise:
- How do I catch mouse over events on individual TableTreeItems (I know how to get mouse {enter|leave|hover} events for the TableTree control but not its items)
- Can I add a clickable icon to the right of the first columns text (I know about the icon limitation for the first TableTree column as the image space is used to draw the expansion control).
- is it possible to add draw stuff on top of the TableTreeViewer at arbitary coordinates?
Any suggestions on how to achieve this would be great.
Thanks,
Raj
|
|
|
Re: mouse over clickable region in TableTreeViewer [message #447918 is a reply to message #447405] |
Tue, 21 December 2004 17:54  |
Eclipse User |
|
|
|
Hi Raj,
- You cannot hook listeners directly to TableTreeItems, but instead have to
listen for TableTree events and compute the item yourself. For an example
of this (just substitute MouseHover or MouseMove for MouseDown) see:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet110.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup .
- You can draw on the viewer by adding a Paint listener to the underlying
Table (use TableTreeViewer.getTableTree().getTable())
- You can also use this Paint listener to add a clickable image. Or
alternatively, you can create Button that is a child of the viewer's
underlying Table.
Grant
"Rajeev Sudra" <rsudra@hotmail.com> wrote in message
news:cpmjta$7f4$1@www.eclipse.org...
> Dear all,
>
> I have a single column TableTreeViewer (i.e. basically a tree but need to
Table lines as may be adding columns in the future). I want to be able able
to display a plus "+" icon against each TableTreeItem when I mouse over it
if it has actions associated with the item. Single clicking on the plus
should display a popup dialog (already in place, currently I display the
popup on double click events on the TableTreeViewer). I would like the icon
to appear on the left hand side of the TableTreeItem or alternatively as an
overlay/floating icon above the TableTreeItem text.
>
> To summarise:
> - How do I catch mouse over events on individual TableTreeItems (I know
how to get mouse {enter|leave|hover} events for the TableTree control but
not its items)
> - Can I add a clickable icon to the right of the first columns text (I
know about the icon limitation for the first TableTree column as the image
space is used to draw the expansion control).
> - is it possible to add draw stuff on top of the TableTreeViewer at
arbitary coordinates?
>
> Any suggestions on how to achieve this would be great.
> Thanks,
> Raj
>
|
|
|
Powered by
FUDForum. Page generated in 0.03350 seconds