Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-02-26 10:51:05 +0000
committerAnsgar Radermacher2014-02-27 08:56:00 +0000
commite6703d8a6e2bfc1313b90319ad5809eb7a32c0fe (patch)
tree49f631615defb4f3f8bc9876be57e10237c29f51 /plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext
parent21ad3138ad03f1df90bc7cd8d945129ef7515808 (diff)
downloadorg.eclipse.papyrus-e6703d8a6e2bfc1313b90319ad5809eb7a32c0fe.tar.gz
org.eclipse.papyrus-e6703d8a6e2bfc1313b90319ad5809eb7a32c0fe.tar.xz
org.eclipse.papyrus-e6703d8a6e2bfc1313b90319ad5809eb7a32c0fe.zip
Bug 429128 - [Xtext] New editor integration does not properly re-install default parser
Diffstat (limited to 'plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext')
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java
index e1bbf4403ad..b1231c64632 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java
@@ -17,6 +17,7 @@ import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfigu
import org.eclipse.papyrus.uml.xtext.integration.StyledTextXtextAdapter;
import org.eclipse.papyrus.uml.xtext.integration.core.ContextElementAdapter;
import org.eclipse.papyrus.uml.xtext.integration.core.ContextElementAdapter.IContextElementProvider;
+import org.eclipse.papyrus.uml.xtext.integration.core.ContextElementAdapter.IContextElementProviderWithInit;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.FocusEvent;
@@ -125,12 +126,22 @@ public class AdvancedEditingPropertySection extends
+ semanticClassName;
String languagePreferred = store.getString(key);
- if (languagePreferred != null && !languagePreferred.equals("")) {
+ if (languagePreferred != null && !languagePreferred.equals("")) { //$NON-NLS-1$
IDirectEditorConfiguration configuration = DirectEditorsUtil
.findEditorConfiguration(languagePreferred,
semanticClassName);
if (configuration instanceof DefaultXtextDirectEditorConfiguration) {
- return (DefaultXtextDirectEditorConfiguration) configuration;
+ DefaultXtextDirectEditorConfiguration xtextConfiguration = (DefaultXtextDirectEditorConfiguration) configuration;
+ IContextElementProvider provider = xtextConfiguration.getContextProvider();
+ if (provider instanceof IContextElementProviderWithInit) {
+ // update resource, if required by text editor
+ if (xtextAdapter != null) {
+ ((IContextElementProviderWithInit) provider).initResource(
+ xtextAdapter.getFakeResourceContext().getFakeResource());
+ }
+ }
+ xtextConfiguration.preEditAction(part.resolveSemanticElement());
+ return xtextConfiguration;
}
}
}

Back to the top