Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2017-04-24 12:24:41 +0000
committerGerrit Code Review @ Eclipse.org2017-05-02 12:02:41 +0000
commit9d63f5553a880b5988475185999a6162af2f9490 (patch)
tree171196731fdbb5646bbaa8d68b54a29a591a4539
parent1b6e74900a0cc0ce184f2c653a4c3d061760cd36 (diff)
downloadorg.eclipse.papyrus-9d63f5553a880b5988475185999a6162af2f9490.tar.gz
org.eclipse.papyrus-9d63f5553a880b5988475185999a6162af2f9490.tar.xz
org.eclipse.papyrus-9d63f5553a880b5988475185999a6162af2f9490.zip
Bug 507932: The XText integration for Direct Edition delete the editing
elements when deleting an empty pair of chars, such as "" https://bugs.eclipse.org/bugs/show_bug.cgi?id=507932 - Modify the edit strategy provider because this one is not correctly corresponding with the inline editor. For the pair elements, in our case, the 'delete' key was not correctly interpreted and the 'Delete From Model' command was interpreted. Change-Id: Ib3a0a1930bf8ecfa8361a3a720f08809fdeb96e6 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.collaborationuse.xtext.ui/src/org/eclipse/papyrus/uml/textedit/collaborationuse/xtext/ui/UmlCollaborationUseUiModule.java12
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.common.xtext.ui/META-INF/MANIFEST.MF3
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.common.xtext.ui/src/org/eclipse/papyrus/uml/textedit/common/xtext/ui/UmlCommonUiModule.java12
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext.ui/src/org/eclipse/papyrus/uml/textedit/connectionpointreference/xtext/ui/UMLConnectionPointReferenceUiModule.java12
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.message.xtext.ui/src/org/eclipse/papyrus/uml/textedit/message/xtext/ui/UmlMessageUiModule.java12
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.xtext.ui/src/org/eclipse/papyrus/uml/textedit/parameter/xtext/ui/UmlParameterUiModule.java12
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/UmlPropertyUiModule.java12
-rwxr-xr-xplugins/uml/textedit/org.eclipse.papyrus.uml.textedit.state.xtext.ui/src/org/eclipse/papyrus/uml/textedit/state/xtext/ui/UmlStateUiModule.java12
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext.ui/src/org/eclipse/papyrus/uml/textedit/stereotypeproperty/xtext/ui/AppliedStereotypePropertyUiModule.java12
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.transition.xtext.ui/src/org/eclipse/papyrus/uml/textedit/transition/xtext/ui/UmlTransitionUiModule.java12
-rw-r--r--plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/ui/UmlValueSpecificationUiModule.java12
-rw-r--r--plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/PapyrusDefaultAutoEditStrategyProvider.java49
12 files changed, 171 insertions, 1 deletions
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.collaborationuse.xtext.ui/src/org/eclipse/papyrus/uml/textedit/collaborationuse/xtext/ui/UmlCollaborationUseUiModule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.collaborationuse.xtext.ui/src/org/eclipse/papyrus/uml/textedit/collaborationuse/xtext/ui/UmlCollaborationUseUiModule.java
index 408320b14d8..0bfee8ac848 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.collaborationuse.xtext.ui/src/org/eclipse/papyrus/uml/textedit/collaborationuse/xtext/ui/UmlCollaborationUseUiModule.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.collaborationuse.xtext.ui/src/org/eclipse/papyrus/uml/textedit/collaborationuse/xtext/ui/UmlCollaborationUseUiModule.java
@@ -13,7 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.textedit.collaborationuse.xtext.ui;
+import org.eclipse.papyrus.uml.xtext.integration.PapyrusDefaultAutoEditStrategyProvider;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider;
/**
* Use this class to register components to be used within the IDE.
@@ -23,4 +25,14 @@ public class UmlCollaborationUseUiModule extends org.eclipse.papyrus.uml.textedi
public UmlCollaborationUseUiModule(AbstractUIPlugin plugin) {
super(plugin);
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.xtext.ui.DefaultUiModule#bindAbstractEditStrategyProvider()
+ */
+ @Override
+ public Class<? extends AbstractEditStrategyProvider> bindAbstractEditStrategyProvider() {
+ return PapyrusDefaultAutoEditStrategyProvider.class;
+ }
}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.common.xtext.ui/META-INF/MANIFEST.MF b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.common.xtext.ui/META-INF/MANIFEST.MF
index 4ae23f7d8b7..f2e59aeae18 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.common.xtext.ui/META-INF/MANIFEST.MF
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.common.xtext.ui/META-INF/MANIFEST.MF
@@ -18,7 +18,8 @@ Require-Bundle: org.eclipse.papyrus.uml.textedit.common.xtext;bundle-version="[2
org.apache.log4j;bundle-version="[1.2.0,2.0.0)",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.infra.emf;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.uml.alf.common.ui;bundle-version="[2.0.0,3.0.0)";visibility:=reexport
+ org.eclipse.papyrus.uml.alf.common.ui;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.uml.xtext.integration.ui;bundle-version="[2.0.0,3.0.0)"
Bundle-Vendor: %providerName
Bundle-Version: 2.0.0.qualifier
Bundle-ManifestVersion: 2
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.common.xtext.ui/src/org/eclipse/papyrus/uml/textedit/common/xtext/ui/UmlCommonUiModule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.common.xtext.ui/src/org/eclipse/papyrus/uml/textedit/common/xtext/ui/UmlCommonUiModule.java
index ec3a7c76daa..812d4bf8471 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.common.xtext.ui/src/org/eclipse/papyrus/uml/textedit/common/xtext/ui/UmlCommonUiModule.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.common.xtext.ui/src/org/eclipse/papyrus/uml/textedit/common/xtext/ui/UmlCommonUiModule.java
@@ -3,7 +3,9 @@
*/
package org.eclipse.papyrus.uml.textedit.common.xtext.ui;
+import org.eclipse.papyrus.uml.xtext.integration.PapyrusDefaultAutoEditStrategyProvider;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider;
/**
* Use this class to register components to be used within the IDE.
@@ -13,4 +15,14 @@ public class UmlCommonUiModule extends org.eclipse.papyrus.uml.textedit.common.x
public UmlCommonUiModule(AbstractUIPlugin plugin) {
super(plugin);
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.xtext.ui.DefaultUiModule#bindAbstractEditStrategyProvider()
+ */
+ @Override
+ public Class<? extends AbstractEditStrategyProvider> bindAbstractEditStrategyProvider() {
+ return PapyrusDefaultAutoEditStrategyProvider.class;
+ }
}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext.ui/src/org/eclipse/papyrus/uml/textedit/connectionpointreference/xtext/ui/UMLConnectionPointReferenceUiModule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext.ui/src/org/eclipse/papyrus/uml/textedit/connectionpointreference/xtext/ui/UMLConnectionPointReferenceUiModule.java
index 455fa49facb..9e50f491886 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext.ui/src/org/eclipse/papyrus/uml/textedit/connectionpointreference/xtext/ui/UMLConnectionPointReferenceUiModule.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext.ui/src/org/eclipse/papyrus/uml/textedit/connectionpointreference/xtext/ui/UMLConnectionPointReferenceUiModule.java
@@ -3,7 +3,9 @@
*/
package org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext.ui;
+import org.eclipse.papyrus.uml.xtext.integration.PapyrusDefaultAutoEditStrategyProvider;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider;
/**
* Use this class to register components to be used within the IDE.
@@ -12,4 +14,14 @@ public class UMLConnectionPointReferenceUiModule extends org.eclipse.papyrus.uml
public UMLConnectionPointReferenceUiModule(AbstractUIPlugin plugin) {
super(plugin);
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.xtext.ui.DefaultUiModule#bindAbstractEditStrategyProvider()
+ */
+ @Override
+ public Class<? extends AbstractEditStrategyProvider> bindAbstractEditStrategyProvider() {
+ return PapyrusDefaultAutoEditStrategyProvider.class;
+ }
}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.message.xtext.ui/src/org/eclipse/papyrus/uml/textedit/message/xtext/ui/UmlMessageUiModule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.message.xtext.ui/src/org/eclipse/papyrus/uml/textedit/message/xtext/ui/UmlMessageUiModule.java
index 671a273ec44..5a5c84e2045 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.message.xtext.ui/src/org/eclipse/papyrus/uml/textedit/message/xtext/ui/UmlMessageUiModule.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.message.xtext.ui/src/org/eclipse/papyrus/uml/textedit/message/xtext/ui/UmlMessageUiModule.java
@@ -13,7 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.textedit.message.xtext.ui;
+import org.eclipse.papyrus.uml.xtext.integration.PapyrusDefaultAutoEditStrategyProvider;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider;
// TODO: Auto-generated Javadoc
/**
@@ -30,4 +32,14 @@ public class UmlMessageUiModule extends org.eclipse.papyrus.uml.textedit.message
public UmlMessageUiModule(AbstractUIPlugin plugin) {
super(plugin);
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.xtext.ui.DefaultUiModule#bindAbstractEditStrategyProvider()
+ */
+ @Override
+ public Class<? extends AbstractEditStrategyProvider> bindAbstractEditStrategyProvider() {
+ return PapyrusDefaultAutoEditStrategyProvider.class;
+ }
}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.xtext.ui/src/org/eclipse/papyrus/uml/textedit/parameter/xtext/ui/UmlParameterUiModule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.xtext.ui/src/org/eclipse/papyrus/uml/textedit/parameter/xtext/ui/UmlParameterUiModule.java
index 5e271c9f16a..890f8185e49 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.xtext.ui/src/org/eclipse/papyrus/uml/textedit/parameter/xtext/ui/UmlParameterUiModule.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.xtext.ui/src/org/eclipse/papyrus/uml/textedit/parameter/xtext/ui/UmlParameterUiModule.java
@@ -13,7 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.textedit.parameter.xtext.ui;
+import org.eclipse.papyrus.uml.xtext.integration.PapyrusDefaultAutoEditStrategyProvider;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider;
/**
* Use this class to register components to be used within the IDE.
@@ -23,4 +25,14 @@ public class UmlParameterUiModule extends org.eclipse.papyrus.uml.textedit.param
public UmlParameterUiModule(AbstractUIPlugin plugin) {
super(plugin);
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.xtext.ui.DefaultUiModule#bindAbstractEditStrategyProvider()
+ */
+ @Override
+ public Class<? extends AbstractEditStrategyProvider> bindAbstractEditStrategyProvider() {
+ return PapyrusDefaultAutoEditStrategyProvider.class;
+ }
}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/UmlPropertyUiModule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/UmlPropertyUiModule.java
index 44364bf175c..d3d1fb28911 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/UmlPropertyUiModule.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.xtext.ui/src/org/eclipse/papyrus/uml/textedit/property/xtext/ui/UmlPropertyUiModule.java
@@ -13,7 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.textedit.property.xtext.ui;
+import org.eclipse.papyrus.uml.xtext.integration.PapyrusDefaultAutoEditStrategyProvider;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider;
/**
* Use this class to register components to be used within the IDE.
@@ -22,4 +24,14 @@ public class UmlPropertyUiModule extends org.eclipse.papyrus.uml.textedit.proper
public UmlPropertyUiModule(AbstractUIPlugin plugin) {
super(plugin);
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.xtext.ui.DefaultUiModule#bindAbstractEditStrategyProvider()
+ */
+ @Override
+ public Class<? extends AbstractEditStrategyProvider> bindAbstractEditStrategyProvider() {
+ return PapyrusDefaultAutoEditStrategyProvider.class;
+ }
}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.state.xtext.ui/src/org/eclipse/papyrus/uml/textedit/state/xtext/ui/UmlStateUiModule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.state.xtext.ui/src/org/eclipse/papyrus/uml/textedit/state/xtext/ui/UmlStateUiModule.java
index 7ea556b25b2..46cee9cf9f1 100755
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.state.xtext.ui/src/org/eclipse/papyrus/uml/textedit/state/xtext/ui/UmlStateUiModule.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.state.xtext.ui/src/org/eclipse/papyrus/uml/textedit/state/xtext/ui/UmlStateUiModule.java
@@ -13,7 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.textedit.state.xtext.ui;
+import org.eclipse.papyrus.uml.xtext.integration.PapyrusDefaultAutoEditStrategyProvider;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider;
/**
* Use this class to register components to be used within the IDE.
@@ -22,4 +24,14 @@ public class UmlStateUiModule extends org.eclipse.papyrus.uml.textedit.state.xte
public UmlStateUiModule(AbstractUIPlugin plugin) {
super(plugin);
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.xtext.ui.DefaultUiModule#bindAbstractEditStrategyProvider()
+ */
+ @Override
+ public Class<? extends AbstractEditStrategyProvider> bindAbstractEditStrategyProvider() {
+ return PapyrusDefaultAutoEditStrategyProvider.class;
+ }
}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext.ui/src/org/eclipse/papyrus/uml/textedit/stereotypeproperty/xtext/ui/AppliedStereotypePropertyUiModule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext.ui/src/org/eclipse/papyrus/uml/textedit/stereotypeproperty/xtext/ui/AppliedStereotypePropertyUiModule.java
index 32a6d33c201..5abecf1d918 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext.ui/src/org/eclipse/papyrus/uml/textedit/stereotypeproperty/xtext/ui/AppliedStereotypePropertyUiModule.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext.ui/src/org/eclipse/papyrus/uml/textedit/stereotypeproperty/xtext/ui/AppliedStereotypePropertyUiModule.java
@@ -13,7 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext.ui;
+import org.eclipse.papyrus.uml.xtext.integration.PapyrusDefaultAutoEditStrategyProvider;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider;
/**
* Use this class to register components to be used within the IDE.
@@ -23,4 +25,14 @@ public class AppliedStereotypePropertyUiModule extends org.eclipse.papyrus.uml.t
public AppliedStereotypePropertyUiModule(AbstractUIPlugin plugin) {
super(plugin);
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.xtext.ui.DefaultUiModule#bindAbstractEditStrategyProvider()
+ */
+ @Override
+ public Class<? extends AbstractEditStrategyProvider> bindAbstractEditStrategyProvider() {
+ return PapyrusDefaultAutoEditStrategyProvider.class;
+ }
}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.transition.xtext.ui/src/org/eclipse/papyrus/uml/textedit/transition/xtext/ui/UmlTransitionUiModule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.transition.xtext.ui/src/org/eclipse/papyrus/uml/textedit/transition/xtext/ui/UmlTransitionUiModule.java
index 0788351bc1c..17c4107de9d 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.transition.xtext.ui/src/org/eclipse/papyrus/uml/textedit/transition/xtext/ui/UmlTransitionUiModule.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.transition.xtext.ui/src/org/eclipse/papyrus/uml/textedit/transition/xtext/ui/UmlTransitionUiModule.java
@@ -3,7 +3,9 @@
*/
package org.eclipse.papyrus.uml.textedit.transition.xtext.ui;
+import org.eclipse.papyrus.uml.xtext.integration.PapyrusDefaultAutoEditStrategyProvider;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider;
/**
* Use this class to register components to be used within the IDE.
@@ -12,4 +14,14 @@ public class UmlTransitionUiModule extends org.eclipse.papyrus.uml.textedit.tran
public UmlTransitionUiModule(AbstractUIPlugin plugin) {
super(plugin);
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.xtext.ui.DefaultUiModule#bindAbstractEditStrategyProvider()
+ */
+ @Override
+ public Class<? extends AbstractEditStrategyProvider> bindAbstractEditStrategyProvider() {
+ return PapyrusDefaultAutoEditStrategyProvider.class;
+ }
}
diff --git a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/ui/UmlValueSpecificationUiModule.java b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/ui/UmlValueSpecificationUiModule.java
index f998f0a162c..b955bd06314 100644
--- a/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/ui/UmlValueSpecificationUiModule.java
+++ b/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui/src/org/eclipse/papyrus/uml/textedit/valuespecification/xtext/ui/UmlValueSpecificationUiModule.java
@@ -3,7 +3,9 @@
*/
package org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui;
+import org.eclipse.papyrus.uml.xtext.integration.PapyrusDefaultAutoEditStrategyProvider;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider;
/**
* Use this class to register components to be used within the IDE.
@@ -12,4 +14,14 @@ public class UmlValueSpecificationUiModule extends org.eclipse.papyrus.uml.texte
public UmlValueSpecificationUiModule(AbstractUIPlugin plugin) {
super(plugin);
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.xtext.ui.DefaultUiModule#bindAbstractEditStrategyProvider()
+ */
+ @Override
+ public Class<? extends AbstractEditStrategyProvider> bindAbstractEditStrategyProvider() {
+ return PapyrusDefaultAutoEditStrategyProvider.class;
+ }
}
diff --git a/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/PapyrusDefaultAutoEditStrategyProvider.java b/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/PapyrusDefaultAutoEditStrategyProvider.java
new file mode 100644
index 00000000000..9b02323a651
--- /dev/null
+++ b/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/PapyrusDefaultAutoEditStrategyProvider.java
@@ -0,0 +1,49 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.xtext.integration;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.xtext.ui.editor.autoedit.DefaultAutoEditStrategyProvider;
+import org.eclipse.xtext.ui.editor.model.TerminalsTokenTypeToPartitionMapper;
+
+/**
+ * The Papyrus default auto edit strategy provider which deny the partition deletion that is not correctly managed in Papyrus XText editor.
+ */
+public class PapyrusDefaultAutoEditStrategyProvider extends DefaultAutoEditStrategyProvider {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.xtext.ui.editor.autoedit.DefaultAutoEditStrategyProvider#configureStringLiteral(org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider.IEditStrategyAcceptor)
+ */
+ @Override
+ protected void configureStringLiteral(final IEditStrategyAcceptor acceptor) {
+ acceptor.accept(partitionInsert.newInstance("\"", "\""), IDocument.DEFAULT_CONTENT_TYPE);
+ acceptor.accept(partitionInsert.newInstance("'", "'"), IDocument.DEFAULT_CONTENT_TYPE);
+ // Don't add the partition deletion for the ' and " characters
+ acceptor.accept(partitionEndSkippingEditStrategy.get(), TerminalsTokenTypeToPartitionMapper.STRING_LITERAL_PARTITION);
+ }
+
+ protected void configureCurlyBracesBlock(IEditStrategyAcceptor acceptor) {
+ // Do nothing here
+ }
+
+ protected void configureSquareBrackets(IEditStrategyAcceptor acceptor) {
+ // Do nothing here
+ }
+
+ protected void configureParenthesis(IEditStrategyAcceptor acceptor) {
+ // Do nothing here
+ }
+} \ No newline at end of file

Back to the top