Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Eugenia] Execute code when property of a node is changed
[Eugenia] Execute code when property of a node is changed [message #766890] Fri, 16 December 2011 15:51 Go to next message
Snakebyte Missing name is currently offline Snakebyte Missing nameFriend
Messages: 130
Registered: November 2011
Senior Member
Hello.
I got the following node in emf.

@gmf.node(label="identifier", border.width="1",border.color="0,0,0",size="130,50",label.icon="false",figure="rectangle")
class AwayGoal extends StandardNode 
{
   ref Goal [1] ReferencedGoal;
   attr String AwayGoalModuleIdentifier; 
}


Everything works great for now.
I want to change the attribute now when the Goal is changed.

Are there any listeners ?
So my problem is that i want to execute some code when the value Goal is changed.

Can somebody give me an example on how to do that ?

Re: [Eugenia] Execute code when property of a node is changed [message #766914 is a reply to message #766890] Fri, 16 December 2011 16:34 Go to previous messageGo to next message
Paulo Alexandre is currently offline Paulo AlexandreFriend
Messages: 17
Registered: November 2011
Junior Member
I was wondering this exactly today...but i think this is a GMF question...maybe, you could take a look at this http://www.eclipse.org/forums/index.php/t/205807/

[Updated on: Fri, 16 December 2011 16:38]

Report message to a moderator

Re: [Eugenia] Execute code when property of a node is changed [message #767303 is a reply to message #766914] Sat, 17 December 2011 15:57 Go to previous messageGo to next message
Snakebyte Missing name is currently offline Snakebyte Missing nameFriend
Messages: 130
Registered: November 2011
Senior Member
As i think, this is only related to the selection in Canvas.
It wont be triggered when the attribute of a node changes, or not ?
Re: [Eugenia] Execute code when property of a node is changed [message #767311 is a reply to message #767303] Sat, 17 December 2011 16:30 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

I believe you should modify the setReferencedGoal() method of AwayGoalImpl in your EMF plugin (don't forget to also change it to @Generated NOT so that it doesn't get overwritten by EMF).

Cheers,
Dimitris
Re: [Eugenia] Execute code when property of a node is changed [message #767333 is a reply to message #767311] Sat, 17 December 2011 17:59 Go to previous messageGo to next message
Snakebyte Missing name is currently offline Snakebyte Missing nameFriend
Messages: 130
Registered: November 2011
Senior Member
This seems to be a good idea.
But if i now change the attribute in the referenced Object, this wont be updated.
Then i also have to edit the setIdentifier Method of the referenced Object.

This solutions seems to be very very dirty.
Can i also implement a changeListener to these objects ?

Re: [Eugenia] Execute code when property of a node is changed [message #767343 is a reply to message #767333] Sat, 17 December 2011 18:33 Go to previous message
Snakebyte Missing name is currently offline Snakebyte Missing nameFriend
Messages: 130
Registered: November 2011
Senior Member
Ok i works when i do it like this.
But still i think it is very dirty.
Can i implement a ChangeListener listening to changes on an attribute as well ?

Can somebody give me an example ?
Previous Topic:EOL Access emf.genmodel
Next Topic:Call EGL generator from GMF editor (generated with Eugenia)
Goto Forum:
  


Current Time: Thu Apr 25 05:15:25 GMT 2024

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

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

Back to the top