Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » The value of semanticAdapter
The value of semanticAdapter [message #1017001] Fri, 08 March 2013 14:32 Go to next message
Mary P. is currently offline Mary P.Friend
Messages: 48
Registered: November 2012
Member
Hello.

When I create a new diagram with my GMF editor an instance of CreateDiagramViewOperation is created.
It has a property private final IAdaptable semanticAdapter;

Where is the value of semanticAdapter taken from? Can I change it somehow? What is this semanticAdapter?

Thanks

Best regards
Mary
Re: The value of semanticAdapter [message #1017040 is a reply to message #1017001] Fri, 08 March 2013 17:54 Go to previous messageGo to next message
Thomas Beyer is currently offline Thomas BeyerFriend
Messages: 55
Registered: February 2013
Member
Hi Mary,

the semanticAdapter is an IAdaptable-Wrapper of your diagram's domain element (the root). The IAdaptable is built in order to be handled by the Eclipse Platform API.

If you check your generated
XXXDiagramEditorUtil.createDiagram(URI diagramURI, URI modelURI,IProgressMonitor progressMonitor)

you will find the declarations:
 XXX model = createInitialModel();

and
Diagram diagram = ViewService.createDiagram(model,XXXEditPart.MODEL_ID,XXXDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);

The first call creates your diagrams domain element, the "model"-element you are looking for.
Follow the second call and you will find where this model is wrapped as an EObjectAdapter (the semanticAdapter).

Yes, you can modify the model. But, make sure not to replace the model by a different interface, as it would break your element-hierarchy.

Regards
Thomas
Re: The value of semanticAdapter [message #1017221 is a reply to message #1017040] Mon, 11 March 2013 08:49 Go to previous message
Mary P. is currently offline Mary P.Friend
Messages: 48
Registered: November 2012
Member
Thank you, Thomas!
You helped me very much =)

Best regards
Mary
Previous Topic:[GMF tooling] Figure with affixed children and internal children
Next Topic:Creating a compartment with embedded nodes
Goto Forum:
  


Current Time: Sat Dec 20 23:43:10 GMT 2014

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

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