Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2014-03-15 07:39:19 -0400
committerLars Vogel2014-03-18 17:03:34 -0400
commitd848adeda39ba939bb91005d46dd69e3b7289508 (patch)
tree2bd02059dcb83fd06a7b63e8514c263def99d133
parentb76af1831346de6fedff2020c59446096421055d (diff)
downloadorg.eclipse.e4.tools-d848adeda39ba939bb91005d46dd69e3b7289508.tar.gz
org.eclipse.e4.tools-d848adeda39ba939bb91005d46dd69e3b7289508.tar.xz
org.eclipse.e4.tools-d848adeda39ba939bb91005d46dd69e3b7289508.zip
Bug 430463 - Retire custom selection serviceI20140318-2200
Change-Id: I6ca62d87e69fa141b4f115b81de068c30be2110b Signed-off-by: Lars Vogel <Lars.Vogel@gmail.com>
-rw-r--r--bundles/org.eclipse.e4.tools.compat/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.e4.tools.compat/OSGI-INF/selectionproviderfunction.xml8
-rw-r--r--bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/SelectionProviderContextFunction.java47
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java17
-rw-r--r--bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/ISelectionProviderService.java15
5 files changed, 5 insertions, 83 deletions
diff --git a/bundles/org.eclipse.e4.tools.compat/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.tools.compat/META-INF/MANIFEST.MF
index 4cfc6248..9f915bb1 100644
--- a/bundles/org.eclipse.e4.tools.compat/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.tools.compat/META-INF/MANIFEST.MF
@@ -14,7 +14,6 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.6.0",
org.eclipse.e4.ui.css.swt.theme;bundle-version="0.9.0",
org.eclipse.e4.ui.di;bundle-version="0.9.0",
org.eclipse.core.databinding;bundle-version="1.4.0"
-Service-Component: OSGI-INF/selectionproviderfunction.xml
Export-Package: org.eclipse.e4.tools.compat.parts
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %Bundle-Vendor
diff --git a/bundles/org.eclipse.e4.tools.compat/OSGI-INF/selectionproviderfunction.xml b/bundles/org.eclipse.e4.tools.compat/OSGI-INF/selectionproviderfunction.xml
deleted file mode 100644
index 15b8531d..00000000
--- a/bundles/org.eclipse.e4.tools.compat/OSGI-INF/selectionproviderfunction.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.e4.tools.compat.selectionprovider">
- <implementation class="org.eclipse.e4.tools.compat.internal.SelectionProviderContextFunction"/>
- <service>
- <provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
- </service>
- <property name="service.context.key" type="String" value="org.eclipse.e4.tools.services.ISelectionProviderService"/>
-</scr:component>
diff --git a/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/SelectionProviderContextFunction.java b/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/SelectionProviderContextFunction.java
deleted file mode 100644
index 1cbc4637..00000000
--- a/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/SelectionProviderContextFunction.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 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
- * Lars Vogel <Lars.Vogel@gmail.com> - Bug 421453
- ******************************************************************************/
-package org.eclipse.e4.tools.compat.internal;
-
-import java.util.List;
-
-import org.eclipse.e4.core.contexts.ContextFunction;
-import org.eclipse.e4.core.contexts.IEclipseContext;
-import org.eclipse.e4.tools.services.ISelectionProviderService;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-public class SelectionProviderContextFunction extends ContextFunction {
-
- @Override
- public Object compute(final IEclipseContext context) {
- return new ISelectionProviderService() {
- @Override
- public void setSelection(Object selection) {
- ISelectionProvider pv = context.get(ISelectionProvider.class);
-
- if( selection == null ) {
- pv.setSelection(StructuredSelection.EMPTY);
- } else if (selection instanceof ISelection) {
- pv.setSelection((ISelection) selection);
- } else if (selection instanceof List<?>) {
- pv.setSelection(new StructuredSelection((List<?>) selection));
- } else if (selection instanceof Object[]) {
- pv.setSelection(new StructuredSelection(
- (Object[]) selection));
- } else {
- pv.setSelection(new StructuredSelection(selection));
- }
- }
- };
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java
index 8a33ff8e..add2ecfe 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java
@@ -55,7 +55,6 @@ import org.eclipse.e4.tools.emf.ui.common.IExtensionLookup;
import org.eclipse.e4.tools.emf.ui.common.IModelExtractor;
import org.eclipse.e4.tools.emf.ui.common.IModelResource;
import org.eclipse.e4.tools.emf.ui.common.IScriptingSupport;
-import org.eclipse.e4.tools.emf.ui.common.ISelectionProviderService;
import org.eclipse.e4.tools.emf.ui.common.MemoryTransfer;
import org.eclipse.e4.tools.emf.ui.common.Util;
import org.eclipse.e4.tools.emf.ui.common.component.AbstractComponentEditor;
@@ -154,6 +153,7 @@ import org.eclipse.e4.ui.model.application.ui.menu.impl.MenuPackageImpl;
import org.eclipse.e4.ui.model.fragment.MModelFragments;
import org.eclipse.e4.ui.model.fragment.impl.FragmentPackageImpl;
import org.eclipse.e4.ui.model.internal.ModelUtils;
+import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
import org.eclipse.e4.ui.workbench.swt.internal.copy.FilteredTree;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.databinding.EMFProperties;
@@ -275,7 +275,10 @@ public class ModelEditor {
private TreeViewer viewer;
private IModelResource modelProvider;
private IProject project;
- private ISelectionProviderService selectionService;
+
+ @Inject
+ ESelectionService selectionService;
+
private IEclipseContext context;
private boolean fragment;
private Handler clipboardHandler;
@@ -975,16 +978,6 @@ public class ModelEditor {
return list;
}
- @Inject
- public void setSelectionService(@Optional ISelectionProviderService selectionService) {
- this.selectionService = selectionService;
- if (viewer != null && !viewer.getControl().isDisposed()) {
- if (!viewer.getSelection().isEmpty() && selectionService != null) {
- selectionService.setSelection(((IStructuredSelection) viewer.getSelection()).getFirstElement());
- }
- }
- }
-
private TreeViewer createTreeViewerArea(Composite parent) {
final Composite treeArea = new Composite(parent, SWT.BORDER);
diff --git a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/ISelectionProviderService.java b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/ISelectionProviderService.java
deleted file mode 100644
index 42b49e77..00000000
--- a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/ISelectionProviderService.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.e4.tools.services;
-
-public interface ISelectionProviderService {
- public void setSelection(Object selection);
-}

Back to the top