Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » cannot capture mouse double click event
cannot capture mouse double click event [message #226778] Thu, 23 November 2006 07:50 Go to next message
Eclipse UserFriend
Originally posted by: yabing.crimsonlogic.com

Hi,
I have a EditPolicy to capture the Mouse double click event, however
the returned request in the method getCommand(Request request) never match
the type REQ.OPEN, which is supposed to be double click event. the type of
request I got are only delete and createChild.
how can I capture the REQ.OPEN request through EditPolicy's request? or
there is another way to capture the mouse event upon a figure? thanks.
Re: cannot capture mouse double click event [message #226895 is a reply to message #226778] Fri, 24 November 2006 21:44 Go to previous message
Anthony Hunter is currently offline Anthony HunterFriend
Messages: 446
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

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

Hi Chen

You can simply handle the request in the performRequest() method in your =
EditPart:

public void performRequest(Request request) {
if (REQ_OPEN.equals(request.getType())) {
MessageDialog.openInformation(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(), "Double Click =
Worked", //$NON-NLS-1$
"Double Click on a node worked"); //$NON-NLS-1$
}
super.performRequest(request);
}

Cheers...
Anthony

"Chen Yabing" <yabing@crimsonlogic.com> wrote in message =
news:bd7bab0ed10599cce6d49da2223539d6$1@www.eclipse.org...
> Hi,
> I have a EditPolicy to capture the Mouse double click event, =
however=20
> the returned request in the method getCommand(Request request) never =
match=20
> the type REQ.OPEN, which is supposed to be double click event. the =
type of=20
> request I got are only delete and createChild.=20
> how can I capture the REQ.OPEN request through EditPolicy's request? =
or=20
> there is another way to capture the mouse event upon a figure? thanks.
>=20
>
------=_NextPart_000_0044_01C70FE7.D9F43230
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.2995" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi Chen</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>You can simply handle the request in =
the=20
performRequest() method in your EditPart:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>&nbsp;&nbsp;&nbsp; public void=20
performRequest(Request request) =
{<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
if (REQ_OPEN.equals(request.getType()))=20
{<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
MessageDialog.openInformation(PlatformUI.getWorkbench()<BR>&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n b=
sp;=20
..getActiveWorkbenchWindow().getShell(), "Double Click Worked",=20
//$NON-NLS-1$<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
"Double Click on a node worked");=20
//$NON-NLS-1$<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
}<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
super.performRequest(request);<BR>&nbsp;&nbsp;&nbsp; }<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Cheers...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Anthony</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"Chen Yabing" &lt;</FONT><A=20
href=3D"mailto:yabing@crimsonlogic.com"><FONT face=3DArial=20
size=3D2>yabing@crimsonlogic.com</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote in=20
message </FONT><A=20
href=3D"news:bd7bab0ed10599cce6d49da2223539d6$1@www.eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:bd7bab0ed10599cce6d49da2223539d6$1@www.eclipse.org</FONT></=
A><FONT=20
face=3DArial size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt;=20
Hi,<BR>&gt;&nbsp;&nbsp;&nbsp; I have a EditPolicy to capture the Mouse =
double=20
click event, however <BR>&gt; the returned request in the method=20
getCommand(Request request) never match <BR>&gt; the type REQ.OPEN, =
which is=20
supposed to be double click event. the type of <BR>&gt; request I got =
are only=20
delete and createChild. <BR>&gt; how can I capture the REQ.OPEN request =
through=20
EditPolicy's request? or <BR>&gt; there is another way to capture the =
mouse=20
event upon a figure? thanks.<BR>&gt; <BR>&gt;</FONT></BODY></HTML>

------=_NextPart_000_0044_01C70FE7.D9F43230--
Previous Topic:parent Composite of public FigureCanvas
Next Topic:The problem about saving and deleting.
Goto Forum:
  


Current Time: Thu Mar 28 16:29:52 GMT 2024

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

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

Back to the top