Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TableTree events not forwarded by TableTreeViewer?
TableTree events not forwarded by TableTreeViewer? [message #448642] Wed, 12 January 2005 18:57 Go to next message
Eclipse UserFriend
Originally posted by: fn2o-mycl.spamex.com

I want to enable and disable right-click menu items depending on which
TreeTableViewer has been clicked clicked like in this Tree example:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet90.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup

I've added listeners for the TableTree events but it appears that the
messages aren't being forwarded by the TableTreeViewer. Is this not
supported, have I done something wrong, or is JFace busted?

TableTree tableTree = (TableTree) tableTreeViewer.getControl();
tableTree.addListener (SWT.MouseDown, new Listener ()
{
public void handleEvent (Event event)
{
// Event is never received.

System.out.println ("TableTree SWT.MouseDown");
}
});
Re: TableTree events not forwarded by TableTreeViewer? [message #448646 is a reply to message #448642] Wed, 12 January 2005 19:12 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_01D6_01C4F8B0.B1AA3130
Content-Type: text/plain;
charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable

You need to do:

TableTree tableTree =3D (TableTree) tableTreeViewer.getControl();
tableTree.getTable().addListener (SWT.MouseDown, new Listener ()
{
public void handleEvent (Event event)
{
// Event is never received.

System.out.println ("TableTree SWT.MouseDown");
}
});

In 3.1, consider using Tree with TreeColumns instead of TableTree. Tree =
does not have these issues.

"Mighty M" <fn2o-mycl@spamex.com> wrote in message =
news:cs3rv0$uqu$1@www.eclipse.org...
>I want to enable and disable right-click menu items depending on which=20
> TreeTableViewer has been clicked clicked like in this Tree example:
>=20
> =
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org=
/eclipse/swt/snippets/Snippet90.java?rev=3DHEAD&content- type=3Dtext/vnd.v=
iewcvs-markup
>=20
> I've added listeners for the TableTree events but it appears that the=20
> messages aren't being forwarded by the TableTreeViewer. Is this not=20
> supported, have I done something wrong, or is JFace busted?
>=20
> TableTree tableTree =3D (TableTree) tableTreeViewer.getControl();
> tableTree.addListener (SWT.MouseDown, new Listener ()
> {
> public void handleEvent (Event event)
> {
> // Event is never received.
>=20
> System.out.println ("TableTree SWT.MouseDown");
> }
> });
>=20
>
------=_NextPart_000_01D6_01C4F8B0.B1AA3130
Content-Type: text/html;
charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-15">
<META content=3D"MSHTML 6.00.2900.2523" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT size=3D2>You need to do:</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>TableTree tableTree =3D (TableTree)=20
tableTreeViewer.getControl();<BR>tableTree.<STRONG><FONT=20
color=3D#ff0000>getTable().</FONT></STRONG>addListener (SWT.MouseDown, =
new=20
Listener ()<BR>{<BR>&nbsp; public void handleEvent (Event =
event)<BR>&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp; // Event is never=20
received.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; System.out.println ("TableTree =

SWT.MouseDown");<BR>&nbsp; }<BR>});</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>In 3.1, consider using Tree with TreeColumns instead =
of=20
TableTree.&nbsp; Tree does not have these issues.<BR></FONT></DIV>
<DIV><FONT size=3D2>"Mighty M" &lt;</FONT><A=20
href=3D"mailto:fn2o-mycl@spamex.com"><FONT=20
size=3D2>fn2o-mycl@spamex.com</FONT></A><FONT size=3D2>&gt; wrote in =
message=20
</FONT><A href=3D"news:cs3rv0$uqu$1@www.eclipse.org"><FONT=20
size=3D2>news:cs3rv0$uqu$1@www.eclipse.org</FONT></A><FONT=20
size=3D2>...</FONT></DIV><FONT size=3D2>&gt;I want to enable and disable =
right-click=20
menu items depending on which <BR>&gt; TreeTableViewer has been clicked =
clicked=20
like in this Tree example:<BR>&gt; <BR>&gt; </FONT><A=20
href=3D" http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets=
/src/org/eclipse/swt/snippets/Snippet90.java?rev=3DHEAD& amp;content-type=3D=
text/vnd.viewcvs-markup"><FONT=20
size=3D2> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppet=
s/src/org/eclipse/swt/snippets/Snippet90.java?rev=3DHEAD& ;amp;content-type=
=3Dtext/vnd.viewcvs-markup</FONT></A><BR><FONT=20
size=3D2>&gt; <BR>&gt; I've added listeners for the TableTree events but =
it=20
appears that the <BR>&gt; messages aren't being forwarded by the=20
TableTreeViewer. Is this not <BR>&gt; supported, have I done something =
wrong, or=20
is JFace busted?<BR>&gt; <BR>&gt; TableTree tableTree =3D (TableTree)=20
tableTreeViewer.getControl();<BR>&gt; tableTree.addListener =
(SWT.MouseDown, new=20
Listener ()<BR>&gt; {<BR>&gt;&nbsp;&nbsp; public void handleEvent (Event =

event)<BR>&gt;&nbsp;&nbsp; {<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // =
Event is=20
never received.<BR>&gt; <BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=2 0
System.out.println ("TableTree SWT.MouseDown");<BR>&gt;&nbsp;&nbsp; =
}<BR>&gt;=20
});<BR>&gt; <BR>&gt;</FONT></BODY></HTML>

------=_NextPart_000_01D6_01C4F8B0.B1AA3130--
Re: TableTree events not forwarded by TableTreeViewer? [message #448661 is a reply to message #448646] Wed, 12 January 2005 23:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fn2o-mycl.spamex.com

Thanks! Where can I get a build that supports TreeColumns? I just
installed Stable Build: 3.1M4 (December 17, 2004) and it doesn't contain a
TreeColumns class.

While attaching the SWT.MouseDown handler to the TableTree captures
right-clicks for the 1st column, no right-click SWT.MoustDown is received
in column two or higher.

Veronika Irvine wrote:

> You need to do:

> TableTree tableTree = (TableTree) tableTreeViewer.getControl();
> tableTree.getTable().addListener (SWT.MouseDown, new Listener ()
> {
> public void handleEvent (Event event)
> {
> // Event is never received.

> System.out.println ("TableTree SWT.MouseDown");
> }
> });

> In 3.1, consider using Tree with TreeColumns instead of TableTree. Tree
does not have these issues.

> "Mighty M" <fn2o-mycl@spamex.com> wrote in message
news:cs3rv0$uqu$1@www.eclipse.org...
>>I want to enable and disable right-click menu items depending on which
>> TreeTableViewer has been clicked clicked like in this Tree example:
>>
>>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet90.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup
>>
>> I've added listeners for the TableTree events but it appears that the
>> messages aren't being forwarded by the TableTreeViewer. Is this not
>> supported, have I done something wrong, or is JFace busted?
>>
>> TableTree tableTree = (TableTree) tableTreeViewer.getControl();
>> tableTree.addListener (SWT.MouseDown, new Listener ()
>> {
>> public void handleEvent (Event event)
>> {
>> // Event is never received.
>>
>> System.out.println ("TableTree SWT.MouseDown");
>> }
>> });
>>
>>
Re: TableTree events not forwarded by TableTreeViewer? [message #448692 is a reply to message #448661] Thu, 13 January 2005 13:34 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
> Thanks! Where can I get a build that supports TreeColumns? I just
> installed Stable Build: 3.1M4 (December 17, 2004) and it doesn't contain a
> TreeColumns class.

It is very new and just became available in this weeks 3.1 integration
build.

> While attaching the SWT.MouseDown handler to the TableTree captures
> right-clicks for the 1st column, no right-click SWT.MoustDown is received
> in column two or higher.

I tested on Windows and I am receiving MouseDown events for all columns.
What platform are you using? Note also that you need to create the
TableTree with the style SWT.FULL_SELECTION in order for
TableTree.getItem(Point) to return an item if click anywhere other than the
first column. Perhaps you are getting the mouse down event but are failing
on the call to getItem.



"Mighty M" <fn2o-mycl@spamex.com> wrote in message
news:cs4alu$mhs$1@www.eclipse.org...
> Thanks! Where can I get a build that supports TreeColumns? I just
> installed Stable Build: 3.1M4 (December 17, 2004) and it doesn't contain a
> TreeColumns class.
>
> While attaching the SWT.MouseDown handler to the TableTree captures
> right-clicks for the 1st column, no right-click SWT.MoustDown is received
> in column two or higher.
>
> Veronika Irvine wrote:
>
>> You need to do:
>
>> TableTree tableTree = (TableTree) tableTreeViewer.getControl();
>> tableTree.getTable().addListener (SWT.MouseDown, new Listener ()
>> {
>> public void handleEvent (Event event)
>> {
>> // Event is never received.
>
>> System.out.println ("TableTree SWT.MouseDown");
>> }
>> });
>
>> In 3.1, consider using Tree with TreeColumns instead of TableTree. Tree
> does not have these issues.
>
>> "Mighty M" <fn2o-mycl@spamex.com> wrote in message
> news:cs3rv0$uqu$1@www.eclipse.org...
>>>I want to enable and disable right-click menu items depending on which
>>>TreeTableViewer has been clicked clicked like in this Tree example:
>>>
>>>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet90.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup
>>>
>>> I've added listeners for the TableTree events but it appears that the
>>> messages aren't being forwarded by the TableTreeViewer. Is this not
>>> supported, have I done something wrong, or is JFace busted?
>>>
>>> TableTree tableTree = (TableTree) tableTreeViewer.getControl();
>>> tableTree.addListener (SWT.MouseDown, new Listener ()
>>> {
>>> public void handleEvent (Event event)
>>> {
>>> // Event is never received.
>>>
>>> System.out.println ("TableTree SWT.MouseDown");
>>> }
>>> });
>>>
>
>
Previous Topic:testing...
Next Topic:Clipboard change notifications?
Goto Forum:
  


Current Time: Mon Nov 18 12:21:26 GMT 2019

Powered by FUDForum. Page generated in 0.01621 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top