Skip to content

Commit e2055b5

Browse files
committed
Fix create commands: ensure we change the content of the Melange editor
1 parent d0c196e commit e2055b5

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

java_execution/java_xdsml/plugins/org.gemoc.execution.sequential.javaxdsml.ide.ui/src/org/gemoc/execution/sequential/javaxdsml/ide/ui/commands/CreateDSAProjectHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public String getSelectionMessage() {
5656
protected void updateMelange(ExecutionEvent event, Language language, Set<String> aspects){
5757
try {
5858
XtextEditor editor = EditorUtils.getActiveXtextEditor();
59-
if (editor != null) { //Update the editor content
59+
if (editor != null && editor.getLanguageName().equals(MELANGE_EDITOR)) { //Update the editor content
6060

6161
IXtextDocument document = editor.getDocument();
6262
document.modify((XtextResource it) -> {

java_execution/java_xdsml/plugins/org.gemoc.execution.sequential.javaxdsml.ide.ui/src/org/gemoc/execution/sequential/javaxdsml/ide/ui/commands/CreateDomainModelProjectHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ else if(nodesOp.isEmpty()){ //no operators, search for '{'
7272

7373

7474
XtextEditor editor = EditorUtils.getActiveXtextEditor();
75-
if (editor != null) {
75+
if (editor != null && editor.getLanguageName().equals(MELANGE_EDITOR)) {
7676
String content = editor.getDocument().get();
7777
startOffset = content.indexOf("{", endName) + 1;
7878
length = 0;
@@ -104,7 +104,7 @@ else if(nodesOp.isEmpty()){ //no operators, search for '{'
104104
int _length = length;
105105
String _newRegion = newRegion;
106106
XtextEditor editor = EditorUtils.getActiveXtextEditor();
107-
if (editor != null) { //Update the editor content
107+
if (editor != null && editor.getLanguageName().equals(MELANGE_EDITOR)) { //Update the editor content
108108
IXtextDocument document = editor.getDocument();
109109
document.modify((XtextResource it) -> {
110110
document.replace(_startOffset,_length, _newRegion);

java_execution/java_xdsml/plugins/org.gemoc.execution.sequential.javaxdsml.ide.ui/src/org/gemoc/execution/sequential/javaxdsml/ide/ui/commands/CreateSiriusEditorProjectHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected void updateMelange(ExecutionEvent event, Language language, String sir
8888
int _length = length;
8989
String _newRegion = newRegion;
9090
XtextEditor editor = EditorUtils.getActiveXtextEditor();
91-
if (editor != null) { //Update the editor content
91+
if (editor != null && editor.getLanguageName().equals(MELANGE_EDITOR)) { //Update the editor content
9292
IXtextDocument document = editor.getDocument();
9393
document.modify((XtextResource it) -> {
9494
document.replace(_startOffset,_length, _newRegion);

0 commit comments

Comments
 (0)