Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrschnekenbu2010-07-23 13:35:12 +0000
committerrschnekenbu2010-07-23 13:35:12 +0000
commita8c658f4e821ca24bdc083a9a2016042bc71295d (patch)
treed42750fc0d2c00c49ed3fecc52db0995143e21e8 /plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui
parentf27e36dcf7b8efa4d1f084de5722f7b6d6211fef (diff)
downloadorg.eclipse.papyrus-a8c658f4e821ca24bdc083a9a2016042bc71295d.tar.gz
org.eclipse.papyrus-a8c658f4e821ca24bdc083a9a2016042bc71295d.tar.xz
org.eclipse.papyrus-a8c658f4e821ca24bdc083a9a2016042bc71295d.zip
Updated the xtext editors not to have an intermediate file for the editing.
Diffstat (limited to 'plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui')
-rwxr-xr-xplugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/plugin.xml4
-rwxr-xr-xplugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/contentassist/UmlStateContentAssistHandler.java53
-rwxr-xr-xplugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/contributions/StatePopupEditorConfigurationContribution.java23
-rwxr-xr-xplugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/editor/ContextEditorUtil.java20
4 files changed, 1 insertions, 99 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/plugin.xml b/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/plugin.xml
index 0d6834abe62..5192e85ef30 100755
--- a/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/plugin.xml
+++ b/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/plugin.xml
@@ -34,10 +34,6 @@
</reference>
</activeWhen>
</handler>
- <handler
- class="org.eclipse.papyrus.state.editor.xtext.ui.contentassist.UmlStateContentAssistHandler"
- commandId="org.eclipse.ui.edit.text.contentAssist.proposals">
- </handler>
</extension>
<extension point="org.eclipse.core.expressions.definitions">
<definition id="org.eclipse.papyrus.state.editor.xtext.UmlState.Editor.opened">
diff --git a/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/contentassist/UmlStateContentAssistHandler.java b/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/contentassist/UmlStateContentAssistHandler.java
deleted file mode 100755
index d86cabd92db..00000000000
--- a/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/contentassist/UmlStateContentAssistHandler.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.state.editor.xtext.ui.contentassist;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.papyrus.state.editor.xtext.ui.editor.ContextEditorUtil;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.texteditor.ContentAssistAction;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.xtext.ui.XtextUIMessages;
-import org.eclipse.xtext.ui.editor.XtextEditor;
-import org.eclipse.xtext.ui.editor.handler.ContentAssistHandler;
-
-public class UmlStateContentAssistHandler extends ContentAssistHandler {
-
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- // TODO Auto-generated method stub
- new ContentAssistAction(XtextUIMessages.getResourceBundle(), "ContentAssistProposal.",
- (ITextEditor) ContextEditorUtil.currentEditor).run();
- return this;
- }
-
- @Override
- public void setEnabled(Object evaluationContext) {
- boolean contentAssistAvailable = false;
- if (evaluationContext instanceof IEvaluationContext) {
- Object var = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_EDITOR_NAME);
- // TODO: this is just for testing....
- var = ContextEditorUtil.currentEditor ;
- //////////////////////////////////////
- if (var instanceof XtextEditor) {
- contentAssistAvailable = ((XtextEditor) var).isContentAssistAvailable();
- }
- }
- super.setBaseEnabled(contentAssistAvailable) ;
- //super.setBaseEnabled(isEnabled() & contentAssistAvailable);
- }
-
-}
diff --git a/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/contributions/StatePopupEditorConfigurationContribution.java b/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/contributions/StatePopupEditorConfigurationContribution.java
index 49f02a2af57..2248005e4b9 100755
--- a/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/contributions/StatePopupEditorConfigurationContribution.java
+++ b/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/contributions/StatePopupEditorConfigurationContribution.java
@@ -24,8 +24,6 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
import org.eclipse.papyrus.core.utils.EditorUtils;
import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.state.editor.xtext.scoping.UmlStateScopeProvider;
-import org.eclipse.papyrus.state.editor.xtext.ui.editor.ContextEditorUtil;
import org.eclipse.papyrus.state.editor.xtext.ui.internal.UmlStateActivator;
import org.eclipse.papyrus.state.editor.xtext.umlState.BehaviorKind;
import org.eclipse.papyrus.state.editor.xtext.umlState.StateRule;
@@ -36,10 +34,7 @@ import org.eclipse.uml2.uml.State;
import org.eclipse.uml2.uml.StateMachine;
import org.eclipse.uml2.uml.UMLFactory;
import org.eclipse.xtext.gmf.glue.PopupEditorConfiguration;
-import org.eclipse.xtext.gmf.glue.edit.part.IEObjectContextUpdater;
-import org.eclipse.xtext.gmf.glue.edit.part.IXTextEditorContextUpdater;
import org.eclipse.xtext.gmf.glue.edit.part.IXtextEMFReconciler;
-import org.eclipse.xtext.ui.editor.XtextEditor;
import com.google.inject.Injector;
@@ -98,22 +93,6 @@ public class StatePopupEditorConfigurationContribution extends PopupEditorConfig
String textToEdit = "" + this.getTextToEdit(graphicalEditPart.resolveSemanticElement());
String fileExtension = "" + ".umlstate";
- // builds a new IEobjectContextUpdater
- IEObjectContextUpdater eobjectContextUpdater = new IEObjectContextUpdater() {
-
- public void updateContext(EObject context) {
- UmlStateScopeProvider.context = context;
- }
- };
-
- // builds a new IXTextEditorContextUpdater
- IXTextEditorContextUpdater xtextEditorContextUpdater = new IXTextEditorContextUpdater() {
-
- public void updateCurrentEditor(XtextEditor context) {
- ContextEditorUtil.currentEditor = context;
- }
- };
-
// builds a new IXtextEMFReconciler.
// Its purpose is to extract any relevant information from the textual specification,
// and then merge it in the context UML model if necessary
@@ -169,7 +148,7 @@ public class StatePopupEditorConfigurationContribution extends PopupEditorConfig
}
}
};
- return super.createPopupEditorHelper(graphicalEditPart, injector, eobjectContextUpdater, xtextEditorContextUpdater, reconciler, textToEdit, fileExtension);
+ return super.createPopupEditorHelper(graphicalEditPart, injector, reconciler, textToEdit, fileExtension);
}
/*
diff --git a/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/editor/ContextEditorUtil.java b/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/editor/ContextEditorUtil.java
deleted file mode 100755
index 6296e43147c..00000000000
--- a/plugins/uml/org.eclipse.papyrus.state.editor.xtext.ui/src/org/eclipse/papyrus/state/editor/xtext/ui/editor/ContextEditorUtil.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.state.editor.xtext.ui.editor;
-
-import org.eclipse.xtext.ui.editor.XtextEditor;
-
-public class ContextEditorUtil {
- public static XtextEditor currentEditor = null ;
-}

Back to the top