Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrschnekenbu2014-01-29 10:46:50 +0000
committerrschnekenbu2014-01-29 10:46:50 +0000
commit1e8a733498b256680e91f05f8ecf4eaf32c1b13d (patch)
treeb8f3aea1d75590368d4a1850702c40bbff466a0e /plugins
parent8b3e521b7cd0e77a60e6f25ebf9e40b8c8f2dbf0 (diff)
parent81c5dd55c3688d199a528be73d70b133793c22b4 (diff)
downloadorg.eclipse.papyrus-1e8a733498b256680e91f05f8ecf4eaf32c1b13d.tar.gz
org.eclipse.papyrus-1e8a733498b256680e91f05f8ecf4eaf32c1b13d.tar.xz
org.eclipse.papyrus-1e8a733498b256680e91f05f8ecf4eaf32c1b13d.zip
Merge branch 'streams/0.10-maintenance' into committers/rschnekenbu/extendedtypes
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeImageEditor.java52
1 files changed, 29 insertions, 23 deletions
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeImageEditor.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeImageEditor.java
index 5f5c0b99ddd..744003a661c 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeImageEditor.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeImageEditor.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2011 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -45,15 +45,15 @@ import org.eclipse.uml2.uml.Image;
/**
* A widget to edit a stereotype image. The image is serialized in order to be
* embedded in the UML xmi model.
- *
+ *
* An expression can be attached to each image, which will be interpreted at runtime
* to determine which image should be displayed.
- *
+ *
* Based on the org.eclipse.papyrus.views.properties.tabbed.profile.imagesection package
* in the org.eclipse.papyrus.views.properties.tabbed.profile plug-in
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public class StereotypeImageEditor extends AbstractPropertyEditor implements SelectionListener {
@@ -138,28 +138,34 @@ public class StereotypeImageEditor extends AbstractPropertyEditor implements Sel
TransactionalEditingDomain domain;
try {
domain = ServiceUtilsForEObject.getInstance().getTransactionalEditingDomain(image);
+
+ AbstractTransactionalCommand operation = new AbstractTransactionalCommand(domain, "Set Image content", null) {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ try {
+ ImageUtil.setContent((Image)getElement(), imgFile);
+ ((Image)getElement()).setFormat(PAPYRUS_FORMAT);
+ } catch (Exception ex) {
+ return CommandResult.newErrorCommandResult(ex);
+ }
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(operation));
} catch (ServiceException ex) {
Activator.log.error(ex);
- return;
- }
- AbstractTransactionalCommand operation = new AbstractTransactionalCommand(domain, "Set Image content", null) {
+ //FIXME: Workaround for Bug 402525. The icon is not yet attached to the editing domain. Modify it directly.
+ ImageUtil.setContent((Image)getElement(), imgFile);
+ ((Image)getElement()).setFormat(PAPYRUS_FORMAT);
+ //////
- /**
- * {@inheritDoc}
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- try {
- ImageUtil.setContent((Image)getElement(), imgFile);
- ((Image)getElement()).setFormat(PAPYRUS_FORMAT);
- } catch (Exception ex) {
- return CommandResult.newErrorCommandResult(ex);
- }
- return CommandResult.newOKCommandResult();
- }
- };
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(operation));
+ //return;
+ }
refresh();
}

Back to the top