Bug 498917 - Use DS annotations in o.e.e4.ui.workbench.swt

Change-Id: I0110996b58a11fd28ea6216bb28acd09a16eea34
Signed-off-by: Dirk Fauth <dirk.fauth@googlemail.com>
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF
index a72ca09..f987ad6 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF
@@ -41,9 +41,11 @@
  org.eclipse.osgi.service.datalocation;version="1.2.0",
  org.eclipse.osgi.service.debug;version="1.1.0",
  org.osgi.framework;version="1.5.0",
+ org.osgi.service.component.annotations;version="1.2.0";resolution:=optional,
  org.osgi.service.event;version="1.3.0",
  org.osgi.service.packageadmin;version="1.2.0",
  org.osgi.util.tracker;version="1.4.0",
  org.w3c.dom.css
-Service-Component: OSGI-INF/testableobject.xml, OSGI-INF/statusreporter.xml,
- OSGI-INF/menuservice.xml
+Service-Component: OSGI-INF/org.eclipse.e4.ui.internal.workbench.swt.MenuServiceCreationFunction.xml,
+ OSGI-INF/org.eclipse.e4.ui.internal.workbench.swt.StatusReporterCreationFunction.xml,
+ OSGI-INF/org.eclipse.e4.ui.internal.workbench.swt.E4Testable.xml
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/testableobject.xml b/bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/org.eclipse.e4.ui.internal.workbench.swt.E4Testable.xml
similarity index 82%
rename from bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/testableobject.xml
rename to bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/org.eclipse.e4.ui.internal.workbench.swt.E4Testable.xml
index 39bb707..64694f7 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/testableobject.xml
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/org.eclipse.e4.ui.internal.workbench.swt.E4Testable.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.ui.testing.TestableObject">
-   <implementation class="org.eclipse.e4.ui.internal.workbench.swt.E4Testable"/>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.e4.ui.internal.workbench.swt.E4Testable">
    <service>
       <provide interface="org.eclipse.ui.testing.TestableObject"/>
    </service>
-</scr:component>
+   <implementation class="org.eclipse.e4.ui.internal.workbench.swt.E4Testable"/>
+</scr:component>
\ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/menuservice.xml b/bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/org.eclipse.e4.ui.internal.workbench.swt.MenuServiceCreationFunction.xml
similarity index 65%
rename from bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/menuservice.xml
rename to bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/org.eclipse.e4.ui.internal.workbench.swt.MenuServiceCreationFunction.xml
index 7bfcfb2..e292d27 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/menuservice.xml
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/org.eclipse.e4.ui.internal.workbench.swt.MenuServiceCreationFunction.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.e4.ui.workbench.swt.menuService">
-   <implementation class="org.eclipse.e4.ui.internal.workbench.swt.MenuServiceCreationFunction"/>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.e4.ui.internal.workbench.swt.MenuServiceCreationFunction">
+   <property name="service.context.key" value="org.eclipse.e4.ui.services.EMenuService"/>
    <service>
       <provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
    </service>
-   <property name="service.context.key" type="String" value="org.eclipse.e4.ui.services.EMenuService"/>
-</scr:component>
+   <implementation class="org.eclipse.e4.ui.internal.workbench.swt.MenuServiceCreationFunction"/>
+</scr:component>
\ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/statusreporter.xml b/bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/org.eclipse.e4.ui.internal.workbench.swt.StatusReporterCreationFunction.xml
similarity index 62%
rename from bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/statusreporter.xml
rename to bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/org.eclipse.e4.ui.internal.workbench.swt.StatusReporterCreationFunction.xml
index 360e6a1..45c2c88 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/statusreporter.xml
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/org.eclipse.e4.ui.internal.workbench.swt.StatusReporterCreationFunction.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.e4.ui.workbench.swt.statusReporter">
-   <implementation class="org.eclipse.e4.ui.internal.workbench.swt.StatusReporterCreationFunction"/>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.e4.ui.internal.workbench.swt.StatusReporterCreationFunction">
+   <property name="service.context.key" value="org.eclipse.e4.core.services.statusreporter.StatusReporter"/>
    <service>
       <provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
    </service>
-   <property name="service.context.key" type="String" value="org.eclipse.e4.core.services.statusreporter.StatusReporter"/>
-</scr:component>
+   <implementation class="org.eclipse.e4.ui.internal.workbench.swt.StatusReporterCreationFunction"/>
+</scr:component>
\ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Testable.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Testable.java
index 96ee80e..cdd0892 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Testable.java
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Testable.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2015 IBM Corporation and others.
+ * Copyright (c) 2010, 2016 IBM Corporation 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
@@ -18,12 +18,14 @@
 import org.eclipse.jface.util.SafeRunnable;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.testing.TestableObject;
+import org.osgi.service.component.annotations.Component;
 
 /**
  * The Workbench's testable object facade to a test harness.
  *
  * @since 3.0
  */
+@Component(service = TestableObject.class)
 public class E4Testable extends TestableObject {
 
 	private Display display;
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/MenuServiceCreationFunction.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/MenuServiceCreationFunction.java
index cd0214f..68d94b8 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/MenuServiceCreationFunction.java
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/MenuServiceCreationFunction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2014 IBM Corporation and others.
+ * Copyright (c) 2010, 2016 IBM Corporation 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
@@ -12,9 +12,12 @@
 
 import org.eclipse.e4.core.contexts.ContextFunction;
 import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IContextFunction;
 import org.eclipse.e4.core.contexts.IEclipseContext;
 import org.eclipse.e4.core.di.InjectionException;
+import org.osgi.service.component.annotations.Component;
 
+@Component(service = IContextFunction.class, property = "service.context.key=org.eclipse.e4.ui.services.EMenuService")
 public class MenuServiceCreationFunction extends ContextFunction {
 
 	@Override
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/StatusReporterCreationFunction.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/StatusReporterCreationFunction.java
index 54baf4c..66a7b2a 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/StatusReporterCreationFunction.java
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/StatusReporterCreationFunction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2014 IBM Corporation and others.
+ * Copyright (c) 2010, 2016 IBM Corporation 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
@@ -12,11 +12,14 @@
 
 import org.eclipse.e4.core.contexts.ContextFunction;
 import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IContextFunction;
 import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.osgi.service.component.annotations.Component;
 
 /**
  *
  */
+@Component(service = IContextFunction.class, property = "service.context.key=org.eclipse.e4.core.services.statusreporter.StatusReporter")
 public class StatusReporterCreationFunction extends ContextFunction {
 
 	@Override