From b22fc43559ba2a52c20109e05bc4035aec25dd1b Mon Sep 17 00:00:00 2001
From: Gabriel Pascual
Date: Thu, 29 Jan 2015 12:06:49 +0100
Subject: Bug 441962: [Xtext Editor] Papyrus does not properly support multiple
 XText editors for UML Elements
 https://bugs.eclipse.org/bugs/show_bug.cgi?id=441962

     - Modification of extension point to add constraint of MetaClass
     - Modification of generation template
     - Integration of Constraint notion in Preferences page
     - User can modify Priority of an Direct Editor through Preferences

Change-Id: I924438c6c6da9b93c73dd2ece2e0d6c4839cabf1
Signed-off-by: Gabriel Pascual <gabriel.pascual@all4tec.net>
---
 .../xtend/aspects/impl/diagram/editparts/TextAware.xtend         | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

(limited to 'plugins/developer/org.eclipse.papyrus.def')

diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/TextAware.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/TextAware.xtend
index e9a108a2f11..452c7b7c381 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/TextAware.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/TextAware.xtend
@@ -752,7 +752,7 @@ def checkExtendedEditor (GenCommonBase it)'''
 	 */
 	protected boolean checkExtendedEditor() {
 		if (resolveSemanticElement() != null) {
-			return org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+			return org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(),this);
 		}
 		return false;
 	}
@@ -779,9 +779,9 @@ def initExtendedEditorConfiguration (GenCommonBase it)'''
 		if (configuration == null) {
 			final String languagePreferred = org.eclipse.papyrus.extensionpoints.editors.Activator.getDefault().getPreferenceStore().getString(org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
 			if (languagePreferred != null && !languagePreferred.equals("")) {
-				configuration = org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+				configuration = org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
 			} else {
-				configuration = org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.findEditorConfiguration(org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+				configuration = org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.findEditorConfiguration(org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
 			}
 		}
 	}
@@ -796,8 +796,7 @@ def updateExtendedEditorConfiguration (GenCommonBase it)'''
 		String languagePreferred = org.eclipse.papyrus.extensionpoints.editors.Activator.getDefault().getPreferenceStore().getString(
 				org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
 		if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
-			configuration = org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
-					.eClass().getInstanceClassName());
+			configuration = org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),this));
 		} else if (org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
 			configuration = null;
 		}
-- 
cgit v1.2.3

