modifications to imported models [message #1798340] |
Thu, 15 November 2018 11:50  |
Eclipse User |
|
|
|
I apologize if this is a repost but I've already written this post once and it was moderated. I've since had a post unmoderated in the newcomers forum and thought it would be wise to attempt again.
I'm having a problem updating a language file programmatically. Specifically, I'm having a problem updating a language file that is imported from the file I begin executing my code in. I'm working within the OSATE framework, which is an Xtext-based implementation of the architecture description language AADL.
To make this concrete, I want to process a model "test.aadl" that imports another model "B.aadl". I've included a screenshot of both files open in the editor below:

My code, shown below, does the following, at a high level.
- I have a contextual AADL element that defines the place I want to make modifications. Usually this is an AADL classifier. You can see it referenced on line 126.
- I manually open the file that contains the classifier. (lines 126 - 145)
- I call getDocument().modify() on the newly opened editor.
- The method doInsert() in this case just creates an abstract type named abs1 and inserts it into the private section of the AADL package containing the provided contextual classifier. (lines 149-162)

When running this code on "test.aadl" and the context element is contained within the test aadl package, the insert works just fine. In this case it opens (it's already open) "test.aadl" and inserts an abstract type "abs1" into the private section of the test package.
When running this code on "test.aadl" and the context element is contained within the B aadl package, the editor is opened (B.aadl pops open in the editor), the model is updated in memory (confirmed through the debugger) but the concrete syntax isn't updated. Running this code repeatedly shows that the model contains N number of duplicates of "abs1", where N is the total number of times this is repeated. This suggets that the model updates are persistent in memory but the concrete syntax just isn't being updated.
I receive no exception traces when executing this code, for what that's worth. Any help or insight into why the imported file's concrete syntax is not being updated would be much appreciated.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04673 seconds