Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeremie.tatibouet2015-05-20 16:05:25 -0400
committerArnaud Cuccuru2015-05-21 07:39:16 -0400
commitb744b51598da15e837e2f1d14e571fad87bf5a8b (patch)
tree7d03971818b2a734f6a492457cafe90cbdaf4ef9 /extraplugins/alf
parentf628ad8100f301f40b84412df377365e071a36a4 (diff)
downloadorg.eclipse.papyrus-b744b51598da15e837e2f1d14e571fad87bf5a8b.tar.gz
org.eclipse.papyrus-b744b51598da15e837e2f1d14e571fad87bf5a8b.tar.xz
org.eclipse.papyrus-b744b51598da15e837e2f1d14e571fad87bf5a8b.zip
Fix incorrect refresh of the ALF editor a compilation.
Fix unecessary creation of textual representation comments. Fix automated population of error log with debug messages Change-Id: If5d01a83c90935a848377bf5f0ea8654a32526a5 Signed-off-by: jeremie.tatibouet <jeremie.tatibouet@cea.fr> Reviewed-on: https://git.eclipse.org/r/48342 Tested-by: Hudson CI Reviewed-by: Arnaud Cuccuru <arnaud.cuccuru@cea.fr> Tested-by: Arnaud Cuccuru <arnaud.cuccuru@cea.fr>
Diffstat (limited to 'extraplugins/alf')
-rw-r--r--extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/commit/CommitScenario.java24
-rw-r--r--extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/commit/SaveScenario.java4
-rw-r--r--extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/job/AlfCompilationJob.java4
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/src/org/eclipse/papyrus/uml/alf/properties/xtext/sheet/ui/listeners/CommitButtonSelectionListener.java5
4 files changed, 31 insertions, 6 deletions
diff --git a/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/commit/CommitScenario.java b/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/commit/CommitScenario.java
index b3017c20764..0cd452e2a45 100644
--- a/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/commit/CommitScenario.java
+++ b/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/commit/CommitScenario.java
@@ -13,7 +13,7 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.alf.transaction.commit;
-import static org.eclipse.papyrus.uml.alf.transaction.ActivatorTransaction.logger;
+//import static org.eclipse.papyrus.uml.alf.transaction.ActivatorTransaction.logger;
import java.sql.Timestamp;
import java.util.Calendar;
@@ -24,6 +24,8 @@ import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.papyrus.uml.alf.libraries.helper.BackupState;
import org.eclipse.papyrus.uml.alf.libraries.helper.BackupState.EditionStatus;
import org.eclipse.papyrus.uml.alf.transaction.job.AlfCompilationJob;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.uml2.uml.NamedElement;
@@ -37,12 +39,21 @@ public class CommitScenario extends ChangeScenario {
* Flag use to know if the commit is required. it may change in the before method
*/
private boolean isCommitRequired;
+
+ /**
+ * Text editor that can be updated when the commit scenario is done
+ */
+ private StyledText view;
public CommitScenario() {
super();
this.isCommitRequired = true;
}
+ public void bindView(StyledText view){
+ this.view = view;
+ }
+
/**
* Update the user model state edition status
*/
@@ -89,8 +100,15 @@ public class CommitScenario extends ChangeScenario {
/**
* This method is automatically called after the job scheduled by this scenario terminates.
*/
- public void after() {
- logger.info("Compilation Job Done");
+ public void after() {
+ if(this.view!=null && !this.view.isDisposed()){
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ CommitScenario.this.view.setText(CommitScenario.this.modelStateToBeCommitted.getContent());
+ }
+ });
+ }
}
}
diff --git a/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/commit/SaveScenario.java b/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/commit/SaveScenario.java
index f877869e1fa..de7ee69f5e2 100644
--- a/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/commit/SaveScenario.java
+++ b/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/commit/SaveScenario.java
@@ -13,7 +13,7 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.alf.transaction.commit;
-import static org.eclipse.papyrus.uml.alf.transaction.ActivatorTransaction.logger;
+//import static org.eclipse.papyrus.uml.alf.transaction.ActivatorTransaction.logger;
import java.sql.Timestamp;
import java.util.Calendar;
@@ -95,6 +95,6 @@ public class SaveScenario extends ChangeScenario {
* This method is automatically called after the job scheduled by this scenario terminates.
*/
public void after() {
- logger.info("Save Job Done");
+ //logger.info("Save Job Done");
}
}
diff --git a/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/job/AlfCompilationJob.java b/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/job/AlfCompilationJob.java
index de19f764d39..218c2dc3b54 100644
--- a/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/job/AlfCompilationJob.java
+++ b/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/job/AlfCompilationJob.java
@@ -19,6 +19,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.uml.alf.libraries.helper.AlfUtil;
import org.eclipse.papyrus.uml.alf.text.generation.DefaultEditStringRetrievalStrategy;
import org.eclipse.papyrus.uml.alf.text.representation.AlfTextualRepresentation;
import org.eclipse.papyrus.uml.alf.transaction.commands.AlfCommandFactory;
@@ -57,6 +58,9 @@ public class AlfCompilationJob extends AlfAbstractJob {
}
/* 3. Execute the commands */
try {
+ if(this.modelElementState.getSource()==null){
+ this.modelElementState.setSource(AlfUtil.getInstance().getTextualRepresentationComment(this.modelElementState.getOwner()));
+ }
domain.getCommandStack().execute(AlfCommandFactory.getInstance().creatSaveCommand(this.modelElementState));
} catch (Exception e) {
e.printStackTrace();
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/src/org/eclipse/papyrus/uml/alf/properties/xtext/sheet/ui/listeners/CommitButtonSelectionListener.java b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/src/org/eclipse/papyrus/uml/alf/properties/xtext/sheet/ui/listeners/CommitButtonSelectionListener.java
index 68036f95e6a..5ac73779dfc 100644
--- a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/src/org/eclipse/papyrus/uml/alf/properties/xtext/sheet/ui/listeners/CommitButtonSelectionListener.java
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/src/org/eclipse/papyrus/uml/alf/properties/xtext/sheet/ui/listeners/CommitButtonSelectionListener.java
@@ -14,6 +14,7 @@
package org.eclipse.papyrus.uml.alf.properties.xtext.sheet.ui.listeners;
+import org.eclipse.papyrus.uml.alf.transaction.commit.CommitScenario;
import org.eclipse.papyrus.uml.alf.transaction.commit.ScenarioFactory;
import org.eclipse.papyrus.uml.alf.properties.xtext.sheet.AlfEditionPropertySection;
import org.eclipse.swt.custom.StyledText;
@@ -40,7 +41,9 @@ public class CommitButtonSelectionListener extends SelectionAdapter {
StyledText editor = this.propertySection.getEditor();
/* 3. Compile without blocking URI */
if (semanticObject != null && editor != null) {
- ScenarioFactory.getInstance().createCommitScenario().execute(semanticObject, editor.getText());
+ CommitScenario commitScenario = (CommitScenario) ScenarioFactory.getInstance().createCommitScenario();
+ commitScenario.bindView(editor);
+ commitScenario.execute(semanticObject, editor.getText());
}
}
}

Back to the top