Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Preferential Updates of shortcuts
Preferential Updates of shortcuts [message #1201033] Thu, 21 November 2013 14:41 Go to next message
V Set is currently offline V SetFriend
Messages: 20
Registered: November 2012
Junior Member
Hi,
I have a design involving shortcuts. Ex: B and C are shortcuts of A in 2 different diagrams. I would like to update B, but this change should not be reflected in either C or A. Similarly if I update C, it should not be visible in B or A. However, if I update A then the change should be propagated to both B and C. I believe there is a way to do this. There must be a listener that I should work off of. I would like some tips or suggestions on where to start.

Thanks,

Re: Preferential Updates of shortcuts [message #1202985 is a reply to message #1201033] Fri, 22 November 2013 12:20 Go to previous messageGo to next message
Michael Golubev is currently offline Michael GolubevFriend
Messages: 383
Registered: July 2009
Senior Member
Hello,

In GMF (-T or not) we use to use the term "shortcut" for the cases where 2 diagram nodes sharing the same semantic element.
So speaking of "shortcuts" leaves you to the only option of storing the additional data in the view information, which I don't think is a good idea.

Instead, I would consider changing the semantic model to handle your requirements.
Something around the lines of:

class RealElement {
   attr String primaryData;
    <...>
}

class ReferenceWithDeferringUpdates {
    ref ReafElement realElement;
    attr String deferredDataHolder;
    derived attr String derivedData; //volatile transient?
    op pushUpdates(); // if (getDeferredDataHolder() != null) getRealElement().setPrimaryData(getDeferredDataHolder())
}

with custom implementation of 
String ReferenceWithDeferringUpdates::getDerivedData() { 
   return getDeferredDataHolder() != null ? getDeferredDataHolder() : getRealElement().getPrimaryData(); 
}

void ReferenceWithDeferringUpdates::setDerivedData(String d) { 
   this.setDeferredDataHolder(d); 
} 




Re: Preferential Updates of shortcuts [message #1211500 is a reply to message #1201033] Tue, 26 November 2013 13:19 Go to previous messageGo to next message
V Set is currently offline V SetFriend
Messages: 20
Registered: November 2012
Junior Member
Thanks. I like this idea and would like to implement it. But could you explain a little bit more about it? I created my model with an ECore and then generated the editor using the GMF Dashboard. Do I make changes to the Ecore diagram or can I update the generated class?
Re: Preferential Updates of shortcuts [message #1213628 is a reply to message #1211500] Wed, 27 November 2013 10:19 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

as far as I stand Michael wants you to have two model elements in your ecore. On for the element itself and one for the link. For both you define shapes etc. in GMF Tooling. For the update he suggest you to use derived attributes. He does it in java. I would personally prefer doing it by using OCL. The OCLInEcore tooling (http://wiki.eclipse.org/OCL/OCLinEcore) can support you here.

Ralph
Previous Topic:How to remove the "mouse over the diagram" menu?
Next Topic:How to define a predefined sequence attributes?
Goto Forum:
  


Current Time: Wed Apr 01 18:05:55 GMT 2020

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

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

Back to the top