diff options
author | Arnaud Cuccuru | 2013-10-03 14:23:12 +0000 |
---|---|---|
committer | Arnaud Cuccuru | 2013-10-03 14:23:12 +0000 |
commit | f9b32bdb44861826562138aa315cc5062b0228a3 (patch) | |
tree | b83a07823a03078747680609821c0b990c6375a5 /plugins | |
parent | 468049eaaff00f875036ada32b42d96ddf504ae5 (diff) | |
parent | ffd9d4745816b11109eb1a7e37abdaceb070dad6 (diff) | |
download | org.eclipse.papyrus-f9b32bdb44861826562138aa315cc5062b0228a3.tar.gz org.eclipse.papyrus-f9b32bdb44861826562138aa315cc5062b0228a3.tar.xz org.eclipse.papyrus-f9b32bdb44861826562138aa315cc5062b0228a3.zip |
Merge branch 'xtext-integration'
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java index 4cc716a9483..acab337eebf 100644 --- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java +++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/contributions/PropertyXtextDirectEditorConfiguration.java @@ -19,6 +19,7 @@ import java.util.List; import org.eclipse.emf.ecore.EObject; import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; @@ -206,11 +207,17 @@ public class PropertyXtextDirectEditorConfiguration extends DefaultXtextDirectEd newVisibility); ICommand setVisibilityCommand = provider.getEditCommand(setVisibilityRequest); updateCommand.add(setVisibilityCommand); - - SetRequest setDefaultValueRequest = new SetRequest(property, UMLPackage.eINSTANCE.getProperty_Default(), - newDefault); - ICommand setDefaultValueCommand = provider.getEditCommand(setDefaultValueRequest); - updateCommand.add(setDefaultValueCommand); + + if (newDefault == null && property.getDefaultValue() != null) { + DestroyElementRequest destroyDefaultValueRequest = new DestroyElementRequest(property.getDefaultValue(), false) ; + ICommand destroyDefaultValueCommand = provider.getEditCommand(destroyDefaultValueRequest) ; + updateCommand.add(destroyDefaultValueCommand); + } + else { + SetRequest setDefaultValueRequest = new SetRequest(property, UMLPackage.eINSTANCE.getProperty_Default(), newDefault); + ICommand setDefaultValueCommand = provider.getEditCommand(setDefaultValueRequest); + updateCommand.add(setDefaultValueCommand); + } SetRequest setRedefinedPropertiesRequest = new SetRequest(property, UMLPackage.eINSTANCE.getProperty_RedefinedProperty(), newRedefines); |