Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Impl Setter not called by diagram(GMF)
Impl Setter not called by diagram [message #697400] Sat, 16 July 2011 16:17 Go to next message
Stu Plu is currently offline Stu PluFriend
Messages: 44
Registered: July 2009
Member
Hi,

Used to use GMF a bit more back in about 2007.
Just done a new diagram and put a breakpoint on a setter for an attribute in the impl class.
I launch in debug mode, add a node and charge the variable (which I am hoping would call the setter). But the breakpoint is never triggered.

Any ideas ?

Thanks,

Stu
Re: Impl Setter not called by diagram [message #697423 is a reply to message #697400] Sat, 16 July 2011 17:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Stu,

Is the changed value showing up in the serialization if you save? If
you set a breakpoint in the constructor for that class, is that getting hit?


On 16/07/2011 9:17 AM, Stu wrote:
> Hi,
>
> Used to use GMF a bit more back in about 2007.
> Just done a new diagram and put a breakpoint on a setter for an
> attribute in the impl class.
> I launch in debug mode, add a node and charge the variable (which I am
> hoping would call the setter). But the breakpoint is never triggered.
>
> Any ideas ?
> Thanks,
>
> Stu


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Impl Setter not called by diagram [message #697496 is a reply to message #697423] Sun, 17 July 2011 01:17 Go to previous messageGo to next message
Stu Plu is currently offline Stu PluFriend
Messages: 44
Registered: July 2009
Member
It does get saved and when I re-open the diagram it is set.

What I am talking about is during editing when I change an attribute on a node, the setter in the nodes impl class doesn't seem to get called.

On one of my old (maybe GMF 2.1) the impl classes had a
public void eSet(int featureID, Object newValue) {
switch (featureID) {

method which would farm the features off to each setter.

But with the new version I cannot see this method it seems to go through:-
eDynamicSet(dynamicFeatureID, eFeature, newValue);
but that doesn't call the setter in the NodeImpl class.

I get the feeling I must have missed something in one of the mapping model files.

[Updated on: Sun, 17 July 2011 03:01]

Report message to a moderator

Re: Impl Setter not called by diagram [message #697504 is a reply to message #697496] Sun, 17 July 2011 01:44 Go to previous messageGo to next message
Stu Plu is currently offline Stu PluFriend
Messages: 44
Registered: July 2009
Member


[Updated on: Sun, 17 July 2011 01:47]

Report message to a moderator

Re: Impl Setter not called by diagram [message #697680 is a reply to message #697496] Sun, 17 July 2011 17:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Stu,

Comments below.

On 16/07/2011 6:17 PM, Stu wrote:
> It does get saved and when I re-open the diagram it is set.
Then clearly something is being set.
>
> What I am talking about is during editing when I change an attribute
> on a node, the setter in the nodes impl class doesn't seem to get
> called.
Is this really on a node or in your model itself?
>
> On one of my old (maybe GMF 2.1) the impl classes had a public
> void eSet(int featureID, Object newValue) {
> switch (featureID) {
>
> method which would farm the features off to each setter.
Yes, each implementation class with features does this.
>
> But with the new version I cannot see this method.
If the implementation class defines getters and setters there must be
reflective code to correspond...
>
> I get the feeling I must have missed something in one of the mapping
> model files.
It's hard to map all this onto your comment about a setter not being
called. Maybe you've set the breakpoint in the wrong class. Clearly a
value is being set...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Impl Setter not called by diagram [message #697681 is a reply to message #697504] Sun, 17 July 2011 18:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Stu,

Comments below.

On 16/07/2011 6:44 PM, Stu wrote:
> The issue seem to be here in the imple class (I get a breakpoint here
> but the baseClass == Expression.class challenge fails:-
> public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?>
> baseClass) {
> if (baseClass == Expression.class) {
> switch (derivedFeatureID) {
> case
> VisualratingPackage.SUB_ELEMENT_EXPRESSION_RULE_ACTION__EXPRESSION:
> return VisualratingPackage.EXPRESSION__EXPRESSION;
>
>
> The baseClass is my subclass of Expression (the variable being set is
> in the Expression class). But as "(baseClass == Expression.class)" is
> NOT true it doesn't get to call the switch statement with the feature
> in it.
So it's not a feature of that specific class. I'm still not sure how
this is relating to your original issue.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Impl Setter not called by diagram [message #697971 is a reply to message #697681] Mon, 18 July 2011 13:52 Go to previous message
Stu Plu is currently offline Stu PluFriend
Messages: 44
Registered: July 2009
Member
Well the only way I found to resolve this was the re-enter the Ecore model and regenerate through once more. Can't tell you why that fixed it but it did.
Previous Topic:graphdef.editor -> Problems when generating diagram code
Next Topic:Node cannot be used in the editor...:(
Goto Forum:
  


Current Time: Thu Apr 18 07:15:42 GMT 2024

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

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

Back to the top