Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Double click event
Double click event [message #123563] Wed, 02 May 2007 22:21 Go to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Ok I've been looking around extension points all day and trying to find how
I can tap into the double click event for a Node or Node Element.

I know GMF has the Open Digram - behaviour that can be added that uses
double click so I guess it can be done.

Maybe on another note - if it is an extension point - How do you find them ?
I have farmed through in eclipse and get the descriptions but no joy.
Re: Double click event [message #123592 is a reply to message #123563] Thu, 03 May 2007 00:55 Go to previous message
Eclipse UserFriend
Originally posted by: khai.n.situvista.com

There are many messages regarding this already but here's a summary:

In the particular EditPart that you want to handle double-click install
an EditPolicy for the OPEN_ROLE like so:

protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();

[snip...]

installEditPolicy(EditPolicyRoles.OPEN_ROLE, createOpenEditPolicy());

}

Then add the createOpenEditPolicy() method like so (in the same EditPart):

private OpenEditPolicy createOpenEditPolicy() {
OpenEditPolicy policy = new OpenEditPolicy() {
protected Command getOpenCommand(Request request) {

/*
* You can create whatever command you need here
*
*/

return [your command];

};
return policy;
}


That's the main idea of it.

Alternatively you can implement the EditPolicyProvider extension if you
have to install custom EditPolicies on many EditParts.

-- Khai --


Stu wrote:
> Ok I've been looking around extension points all day and trying to find how
> I can tap into the double click event for a Node or Node Element.
>
> I know GMF has the Open Digram - behaviour that can be added that uses
> double click so I guess it can be done.
>
> Maybe on another note - if it is an extension point - How do you find them ?
> I have farmed through in eclipse and get the descriptions but no joy.
>
>
Previous Topic:Opening a GMF diagram from java code
Next Topic:How to get ToolEntry for a tool ?
Goto Forum:
  


Current Time: Sun Jun 08 22:40:02 EDT 2025

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

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

Back to the top