Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Eugenia] Adding options to a node
[Eugenia] Adding options to a node [message #759078] Sat, 26 November 2011 01:10 Go to next message
Snakebyte Missing name is currently offline Snakebyte Missing nameFriend
Messages: 130
Registered: November 2011
Senior Member
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: Sat, 26 November 2011 01:10]

Report message to a moderator

Re: [Eugenia] Adding options to a node [message #759099 is a reply to message #759078] Sat, 26 November 2011 11:15 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

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 11:15]

Report message to a moderator

Re: [Eugenia] Adding options to a node [message #759126 is a reply to message #759099] Sat, 26 November 2011 15:59 Go to previous messageGo to next message
Snakebyte Missing name is currently offline Snakebyte Missing nameFriend
Messages: 130
Registered: November 2011
Senior Member
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 22:53]

Report message to a moderator

Re: [Eugenia] Adding options to a node [message #759150 is a reply to message #759126] Sat, 26 November 2011 22:56 Go to previous messageGo to next message
Snakebyte Missing name is currently offline Snakebyte Missing nameFriend
Messages: 130
Registered: November 2011
Senior Member
@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 23:51]

Report message to a moderator

Re: [Eugenia] Adding options to a node [message #759155 is a reply to message #759150] Sun, 27 November 2011 01:08 Go to previous messageGo to next message
Snakebyte Missing name is currently offline Snakebyte Missing nameFriend
Messages: 130
Registered: November 2011
Senior Member
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 19:33 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

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 13:47 Go to previous message
Snakebyte Missing name is currently offline Snakebyte Missing nameFriend
Messages: 130
Registered: November 2011
Senior Member
Thanks!

[Updated on: Thu, 01 December 2011 18:26]

Report message to a moderator

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


Current Time: Sat Apr 20 04:27:26 GMT 2024

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

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

Back to the top