Skip to main content



      Home
Home » Modeling » Epsilon » [Eugenia] Adding options to a node
[Eugenia] Adding options to a node [message #759078] Fri, 25 November 2011 20:10 Go to next message
Eclipse UserFriend
Hello,

my question is how i add specific actions to a node.

For example i have the following node in my model :

class Claim {
    attr String path;
}



When i right click on an instance of that node in canvas, i got a drop down menu where i can "add note" for example.
Can i add new options to this drop down menu and execute my own java code when the action is clicked ?

For example can i open the file specified in path variable ?

Greetings

[Updated on: Fri, 25 November 2011 20:10] by Moderator

Re: [Eugenia] Adding options to a node [message #759099 is a reply to message #759078] Sat, 26 November 2011 06:15 Go to previous messageGo to next message
Eclipse UserFriend
Eugenia does not support that, I'm afraid. You'll need to tweak the GMF code generation models and the generated code for that.

Have you tried asking over on the GMF forum? I'm sure they'll be able to provide more information on what you need to do Smile.

[Updated on: Sat, 26 November 2011 06:15] by Moderator

Re: [Eugenia] Adding options to a node [message #759126 is a reply to message #759099] Sat, 26 November 2011 10:59 Go to previous messageGo to next message
Eclipse UserFriend
Is it possible to add that option like mentioned here ?

http://www.eclipse.org/articles/article.php?file=Article-action-contribution/index.html#example3

But i dont know the right expansion points etc.

[Updated on: Sat, 26 November 2011 17:53] by Moderator

Re: [Eugenia] Adding options to a node [message #759150 is a reply to message #759126] Sat, 26 November 2011 17:56 Go to previous messageGo to next message
Eclipse UserFriend
@namespace(uri="trustcasemodel", prefix="trustcasemodel")
@gmf(foo="bar")
package trustCase;

@gmf.diagram(onefile="false")
class TrustCase {
val Claim[*] valclaims;
}

class Claim {
   attr String path;
}


How can i get the path property of the selected Claim in the editor when using javacode?
In another plugin for example ?

[Updated on: Sat, 26 November 2011 18:51] by Moderator

Re: [Eugenia] Adding options to a node [message #759155 is a reply to message #759150] Sat, 26 November 2011 20:08 Go to previous messageGo to next message
Eclipse UserFriend
Common,

it must be possible to read the properties from a node in java in any way.
Re: [Eugenia] Adding options to a node [message #759484 is a reply to message #759155] Mon, 28 November 2011 14:33 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

In your extension you need to specify org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart as the objectClass. You can then get the EObject that underpins the graphical part using its resolveSemanticElement() method.

Cheers,
Dimitris
Re: [Eugenia] Adding options to a node [message #760154 is a reply to message #759484] Thu, 01 December 2011 08:47 Go to previous message
Eclipse UserFriend
Thanks!

[Updated on: Thu, 01 December 2011 13:26] by Moderator

Previous Topic:[Eugenia] Containing Relation ? Bug ?
Next Topic:[GMF] Containment Problem
Goto Forum:
  


Current Time: Wed Jul 23 18:35:37 EDT 2025

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

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

Back to the top