Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problems with LazyLinkingResource URI in GMF integration
Problems with LazyLinkingResource URI in GMF integration [message #1470465] Wed, 12 November 2014 11:04
Petri Savola is currently offline Petri SavolaFriend
Messages: 7
Registered: December 2013
Junior Member
Hi,

I'm working with a GMF editor which has separate notation and semantic models. Semantic model is serialized using Xtext. When creating a new diagram, DslDiagramcreateDiagramEditorUtil.createDiagram is used and two URIs are given for this method. These URIs are by default not encoded.

When editor is opened, DslDocumentProvider adds resource set listener for the underlying semantic model, which triggers refresh for the diagram if the semantic model is modified outside the editor (for example with a quick fix).

Everything works like a charm, with the exception that whenever diagram name contains whitespaces, diagram is not notified when the underlying semantic model is changed and in order to see the modifications you need to close and reopen the editor. Because editor is not aware that the semantic model has been changed, it will also override the modifications without asking anything from the user.

This problem can be solved by giving encoded URIs when creating diagrams, but I'm wondering if there are any other ways to solve the issue. The listener mechanism seems to assume that URIs need to be fully encoded, but I haven't found any good solution to this problem.

In the problematic situation the resource set will contain two resources:
* GMFResource for the notation model (fully encoded)
* LazyLinkingResource for the semantic model (last segment not encoded, otherwise encoded)
* In notation model href for the semantic element is not encoded

It seems odd that LazyLinkingResource is partially encoded, but GMFResource is fully encoded. In this case refresh is not triggered properly when the semantic model is changed outside the editor.

Example: If I create two resources in the following way:
TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
final Resource diagramResource = editingDomain.getResourceSet().createResource(diagramURI);
final Resource modelResource = editingDomain.getResourceSet().createResource(modelURI);
for (Resource res : editingDomain.getResourceSet().getResources()) {
    System.err.println("# " + res);
}

I get GMFResource which has fully encoded URI and LazyLinkingResource, which has partially encoded URI, given that diagramURI and modelURI are not encoded at all. I'm not sure if this issue is related to the actual problem, but it could be.

Thanks for your help!

[Updated on: Wed, 12 November 2014 11:06]

Report message to a moderator

Previous Topic:xtext-maven-plugin overwriting output configuration
Next Topic:No EObjectDescription could be found in Scope
Goto Forum:
  


Current Time: Fri Mar 29 15:38:40 GMT 2024

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

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

Back to the top