Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2018-03-30 11:26:41 +0000
committerAnsgar Radermacher2018-04-16 06:26:04 +0000
commit9bb03d919d334eb3b10ad2bbeeb033412da4f3f5 (patch)
tree7334d801ef755e0be3fee12a223f552db973d5ba /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml
parent224dfa1c661ec52f4b837d272656f69b61b59799 (diff)
downloadorg.eclipse.papyrus-9bb03d919d334eb3b10ad2bbeeb033412da4f3f5.tar.gz
org.eclipse.papyrus-9bb03d919d334eb3b10ad2bbeeb033412da4f3f5.tar.xz
org.eclipse.papyrus-9bb03d919d334eb3b10ad2bbeeb033412da4f3f5.zip
Bug 528199 - [Xtext, Constraints] The edition of constraints does not choose a suitable editor
- Cleanup implementation in DirectEditorsUtil: * Assure that method implementations are consistent and based on each other (before, implementations were duplicated, some respected priorities while others did not), fix comments * Rename getDirectEditorConfiguration (name was misleading, keep old method as deprecated) - Set version of oep.extensionpoints.editors plugin to 3.0.0, adapt all references (other MANIFEST files) accordingly - If no editor with for a given language is found, search all editors without taking language tag into account (implementations must still be compatible with semantic element). This assures that other editors are used, if the default editor is not compatible (e.g. OCL is default editor for opaque expression, but not compatible with non-OCL bodies) - Add an EmbeddedEditor.usecases txt file in plugin oep.extensionpoints.editors - Replace calls to old methods (in diagram.common, property.sheet, uml.diagram.sequence, diagram.stereotype.edition, service.types.ui and natable.xtext.valuespecification/integration) - Move OCL editor registration from generic plugin oep.uml.properties.xtext to OCL plugin. - Add a test to the existing oep.uml.textedit.tests plugin that checks whether a suitable editor is opened on an opaque expression with (1) a C++ body and (2) OCL body (the plugin registers a dummy C++ editor) Signed-off-by: Ansgar Radermacher <ansgar.radermacher@cea.fr> Change-Id: I4cee823b91e13f9601ecb7a9655409a74e3d7579
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeMultilinePropertyEditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypePropertyEditPart.java10
2 files changed, 9 insertions, 9 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeMultilinePropertyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeMultilinePropertyEditPart.java
index d0a8ed742ad..a301488011f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeMultilinePropertyEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeMultilinePropertyEditPart.java
@@ -723,7 +723,7 @@ public class AppliedStereotypeMultilinePropertyEditPart extends CompartmentEditP
protected boolean checkExtendedEditor() {
EObject resolveSemanticElement = resolveSemanticElement();
if (resolveSemanticElement != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement.eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement);
}
return false;
}
@@ -745,9 +745,9 @@ public class AppliedStereotypeMultilinePropertyEditPart extends CompartmentEditP
if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + AppliedStereotypeProperty.class.getName());
if (languagePreferred != null && !"".equals(languagePreferred)) { //$NON-NLS-1$
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, AppliedStereotypeProperty.class.getName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement());
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, AppliedStereotypeProperty.class.getName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement());
}
}
}
@@ -759,7 +759,7 @@ public class AppliedStereotypeMultilinePropertyEditPart extends CompartmentEditP
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + AppliedStereotypeProperty.class.getName());
if (languagePreferred != null && !"".equals(languagePreferred) && languagePreferred != configuration.getLanguage()) { //$NON-NLS-1$
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, AppliedStereotypeProperty.class.getName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement());
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypePropertyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypePropertyEditPart.java
index 50b06d09848..6124ed697c1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypePropertyEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypePropertyEditPart.java
@@ -67,8 +67,8 @@ import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.adapter.SemanticAdapter;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editparts.UMLCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
@@ -732,7 +732,7 @@ public class AppliedStereotypePropertyEditPart extends UMLCompartmentEditPart im
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement());
}
return false;
}
@@ -754,9 +754,9 @@ public class AppliedStereotypePropertyEditPart extends UMLCompartmentEditPart im
if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("")) {//$NON-NLS-1$
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement());
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement());
}
}
}
@@ -768,7 +768,7 @@ public class AppliedStereotypePropertyEditPart extends UMLCompartmentEditPart im
protected void updateExtendedEditorConfiguration() {
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {//$NON-NLS-1$
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement());
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}

Back to the top