-
I try to implement a custom SourceModelStorage. In the loadSourceModel I can get the source file uri with @Override
public void loadSourceModel(final RequestModelAction action) {
Map<String, String> options = action.getOptions();
String uri = options.get("uri");
........
} This is a little bit clumsy but I am fine with this. When I try to implement the method saveSourceModel I expect that SaveModelAction param provides me with the target file uri @Override
public void saveSourceModel(final SaveModelAction action) {
Optional<String> uri = action.getFileUri();
....
} Beside the fact that the method parameter has a different layout as in the load method the My only solution for now is to store the file path during the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
To make querying the options less clumsy, there is a The The It might help to look at the rather new |
Beta Was this translation helpful? Give feedback.
-
If my answer is fine with you and you agree that no code change is required, I suggest that we convert this into a discussion rather than an isse. Any objections @rsoika? |
Beta Was this translation helpful? Give feedback.
-
that is ok for me to to close this issue or move it into discussion. |
Beta Was this translation helpful? Give feedback.
To make querying the options less clumsy, there is a
ClientOptionsUtil
util.The
SaveModelAction
only contains afileUri
if it is a save-as action, that is the model should be saved into a different file than the one that is currently opened. See also https://github.com/eclipse-glsp/glsp/blob/master/PROTOCOL.md#251-savemodelactionThe
ModelState
stores all options of the originalRequestModelAction
in the client options. So iffileUri
is not set in theSaveModelAction
, you can retrieve the original file URI from the model state.It might help to look at the rather new
org.eclipse.glsp.server.emf
package. It contains a module set-up and several default implementations specifically for EMF …