Using Xtext embedded Editor how to synchronize back the changes ? [message #1725910] |
Tue, 08 March 2016 08:30  |
Eclipse User |
|
|
|
Hello,
I have followed this example http://fr.slideshare.net/meysholdt/lightweight-xtext-editorsasswtwidgets to integrate the Xtext editor of a grammer I created (BPmodel) in a composite - part of swt form, in a windowbuilder project, where the application that carries the EmbdedEditor is an Eclipse plugin.
The integration works, now I would like to fully use the embeddedEditor and synchronize back the changes with the entries of the users.
The presentation in the attached file gives some indications on how to use partial editors :
public EmbeddedEditorModelAccess createPartialEditor(
String prefix, String editablePart, String suffix,
boolean insertLineBreaks)
Is it what I should use to allow entering a specific rule of the grammer's model ?
In this case, what should the prefix and the suffix be ? knowing that I don't know in advance what the user will enter..
And how to synchronize back the changes.. I don't know exactly which use case I have : "Simple String edited with tooling and writtenback to the model as a String"
org.eclipse.xtext.resource.XtextResource.update(int, int, String)
public void update(int offset, int replacedTextLength, String newText)
or "Complete model edited and editable part
should be updated in resource" ??
org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorModelAccess
public void updateModel(String prefix, String editablePart, String suffix)
Anyways how can I get these the elements needed to call the methods update or updateModel ?
Thanks in advance,
Nawel
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04704 seconds