Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2015-06-19 09:10:14 +0000
committerTom Schindl2015-06-19 09:10:14 +0000
commit0f3730cb162d7480d4439f599e3cb5b455c1d5a4 (patch)
tree3497db49855c9c11bef46551a7e43eaaef96b0ab /experimental
parenta2d188ee1edc4223f619cea22c153a84525e7622 (diff)
downloadorg.eclipse.efxclipse-0f3730cb162d7480d4439f599e3cb5b455c1d5a4.tar.gz
org.eclipse.efxclipse-0f3730cb162d7480d4439f599e3cb5b455c1d5a4.tar.xz
org.eclipse.efxclipse-0f3730cb162d7480d4439f599e3cb5b455c1d5a4.zip
moved the model stuff out of the generic editor things
Diffstat (limited to 'experimental')
-rw-r--r--experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/META-INF/MANIFEST.MF3
-rw-r--r--experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/OSGI-INF/services/workbenchmodelcf.xml8
-rw-r--r--experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/src/org/eclipse/fx/code/compensator/editor/contrib/WorkbenchModelContextFunction.java52
3 files changed, 1 insertions, 62 deletions
diff --git a/experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/META-INF/MANIFEST.MF b/experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/META-INF/MANIFEST.MF
index 68645d61d..51175b5e8 100644
--- a/experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/META-INF/MANIFEST.MF
+++ b/experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/META-INF/MANIFEST.MF
@@ -10,14 +10,13 @@ Require-Bundle: org.eclipse.fx.code.compensator.editor;bundle-version="1.0.0",
org.eclipse.text;bundle-version="3.5.300",
org.eclipse.fx.text;bundle-version="1.0.0",
org.eclipse.fx.text.ui;bundle-version="1.0.0",
- org.eclipse.fx.code.compensator.model;bundle-version="0.1.0",
org.eclipse.emf.ecore.xmi;bundle-version="2.10.0",
org.eclipse.fx.ui.services,
org.eclipse.e4.core.di;bundle-version="1.4.0",
org.eclipse.e4.core.services,
org.eclipse.osgi.services,
org.eclipse.fx.core
-Service-Component: OSGI-INF/services/servicecollector.xml,OSGI-INF/services/inputcf.xml,OSGI-INF/services/documentcf.xml,OSGI-INF/services/partitionercf.xml,OSGI-INF/services/sourceconfigcf.xml,OSGI-INF/services/workbenchmodelcf.xml,OSGI-INF/services/activeOutline.xml,OSGI-INF/services/proposalcomputercf.xml,OSGI-INF/services/annotationmodelrcf.xml,
+Service-Component: OSGI-INF/services/servicecollector.xml,OSGI-INF/services/inputcf.xml,OSGI-INF/services/documentcf.xml,OSGI-INF/services/partitionercf.xml,OSGI-INF/services/sourceconfigcf.xml,OSGI-INF/services/activeOutline.xml,OSGI-INF/services/proposalcomputercf.xml,OSGI-INF/services/annotationmodelrcf.xml,
OSGI-INF/services/defaultstylesheet.xml
Bundle-ActivationPolicy: lazy
Import-Package: javax.annotation;version="1.2.0",
diff --git a/experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/OSGI-INF/services/workbenchmodelcf.xml b/experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/OSGI-INF/services/workbenchmodelcf.xml
deleted file mode 100644
index 16717f30e..000000000
--- a/experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/OSGI-INF/services/workbenchmodelcf.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.fx.code.compensator.editor.contrib.workbenchmodel">
- <implementation class="org.eclipse.fx.code.compensator.editor.contrib.WorkbenchModelContextFunction"/>
- <service>
- <provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
- </service>
- <property name="service.context.key" type="String" value="org.eclipse.fx.code.compensator.model.workbench.Workbench"/>
-</scr:component>
diff --git a/experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/src/org/eclipse/fx/code/compensator/editor/contrib/WorkbenchModelContextFunction.java b/experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/src/org/eclipse/fx/code/compensator/editor/contrib/WorkbenchModelContextFunction.java
deleted file mode 100644
index 6a72cb441..000000000
--- a/experimental/compensator/org.eclipse.fx.code.compensator.editor.contrib/src/org/eclipse/fx/code/compensator/editor/contrib/WorkbenchModelContextFunction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2014 BestSolution.at 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:
-* Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation
-*******************************************************************************/
-package org.eclipse.fx.code.compensator.editor.contrib;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.eclipse.e4.core.contexts.ContextFunction;
-import org.eclipse.e4.core.contexts.IEclipseContext;
-import org.eclipse.e4.ui.model.application.MApplication;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
-import org.eclipse.fx.code.compensator.model.workbench.Workbench;
-import org.eclipse.fx.code.compensator.model.workbench.WorkbenchFactory;
-
-public class WorkbenchModelContextFunction extends ContextFunction {
- @Override
- public Object compute(IEclipseContext context) {
- context = context.get(MApplication.class).getContext();
- Workbench wb = (Workbench) context.get("LocalWorkbench");
- if( wb == null ) {
- File folder = (File) context.get("data-dir");
- File f = new File(folder, "/workbench.xmi");
- if( f.exists() ) {
- try {
- Resource r = new XMIResourceImpl(URI.createFileURI(f.getAbsolutePath()));
- r.load(null);
- wb = (Workbench) r.getContents().get(0);
- context.set("LocalWorkbench", wb);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } else {
- XMIResourceImpl r = new XMIResourceImpl(URI.createFileURI(f.getAbsolutePath()));
- wb = WorkbenchFactory.eINSTANCE.createWorkbench();
- r.getContents().add(wb);
- context.set("LocalWorkbench", wb);
- }
- }
- return wb;
- }
-}

Back to the top