Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-09-05 05:55:39 -0400
committerMatthias Sohn2019-09-08 13:59:42 -0400
commitb3116696697b28bef9710da28ed4af9441414f8f (patch)
treece42088455064b0923081c604293387500aba490 /org.eclipse.egit.ui
parent306bc78bfcc7d6e745647d09dc3e8b320ef84f36 (diff)
downloadegit-b3116696697b28bef9710da28ed4af9441414f8f.tar.gz
egit-b3116696697b28bef9710da28ed4af9441414f8f.tar.xz
egit-b3116696697b28bef9710da28ed4af9441414f8f.zip
Use an OSGi declarative service instead of IStartup
Replace the IStartup and org.eclipse.ui.startup extension point by a declarative OSGi service component listening on UIEvents.UILifeCycle.APP_STARTUP_COMPLETE. Bug: 550742 Change-Id: I04ee521810f0aa05f64f24460f07ea5060505dfc Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Diffstat (limited to 'org.eclipse.egit.ui')
-rw-r--r--org.eclipse.egit.ui/.project5
-rw-r--r--org.eclipse.egit.ui/.settings/org.eclipse.pde.ds.annotations.prefs8
-rw-r--r--org.eclipse.egit.ui/META-INF/MANIFEST.MF5
-rw-r--r--org.eclipse.egit.ui/OSGI-INF/org.eclipse.egit.ui.internal.clone.GitCloneDropAdapter.xml8
-rw-r--r--org.eclipse.egit.ui/build.properties3
-rw-r--r--org.eclipse.egit.ui/plugin.xml6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneDropAdapter.java12
7 files changed, 36 insertions, 11 deletions
diff --git a/org.eclipse.egit.ui/.project b/org.eclipse.egit.ui/.project
index e0541bc54..dd0a4f88a 100644
--- a/org.eclipse.egit.ui/.project
+++ b/org.eclipse.egit.ui/.project
@@ -25,6 +25,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
diff --git a/org.eclipse.egit.ui/.settings/org.eclipse.pde.ds.annotations.prefs b/org.eclipse.egit.ui/.settings/org.eclipse.pde.ds.annotations.prefs
new file mode 100644
index 000000000..73a356b6d
--- /dev/null
+++ b/org.eclipse.egit.ui/.settings/org.eclipse.pde.ds.annotations.prefs
@@ -0,0 +1,8 @@
+classpath=true
+dsVersion=V1_3
+eclipse.preferences.version=1
+enabled=true
+generateBundleActivationPolicyLazy=true
+path=OSGI-INF
+validationErrorLevel=error
+validationErrorLevel.missingImplicitUnbindMethod=error
diff --git a/org.eclipse.egit.ui/META-INF/MANIFEST.MF b/org.eclipse.egit.ui/META-INF/MANIFEST.MF
index ea9a1e251..0deaa40bb 100644
--- a/org.eclipse.egit.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.egit.ui/META-INF/MANIFEST.MF
@@ -29,9 +29,12 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)",
org.eclipse.jdt.core;bundle-version="[3.12.0,4.0.0)";resolution:=optional,
org.eclipse.jdt.ui;bundle-version="[3.12.0,4.0.0)";resolution:=optional,
org.eclipse.ui.views;bundle-version="[3.8.100,4.0.0)",
- org.eclipse.e4.core.contexts;bundle-version="[1.5.1,2.0.0)"
+ org.eclipse.osgi.services;bundle-version="[3.5.100,4.0.0)",
+ org.eclipse.e4.core.contexts;bundle-version="[1.5.1,2.0.0)",
+ org.eclipse.e4.ui.workbench;bundle-version="[1.4.0,2.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Service-Component: OSGI-INF/org.eclipse.egit.ui.internal.clone.GitCloneDropAdapter.xml
Import-Package: org.eclipse.egit.core;version="[5.6.0,5.7.0)",
org.eclipse.egit.core.attributes;version="[5.6.0,5.7.0)",
org.eclipse.egit.core.internal;version="[5.6.0,5.7.0)",
diff --git a/org.eclipse.egit.ui/OSGI-INF/org.eclipse.egit.ui.internal.clone.GitCloneDropAdapter.xml b/org.eclipse.egit.ui/OSGI-INF/org.eclipse.egit.ui.internal.clone.GitCloneDropAdapter.xml
new file mode 100644
index 000000000..12e50ed70
--- /dev/null
+++ b/org.eclipse.egit.ui/OSGI-INF/org.eclipse.egit.ui.internal.clone.GitCloneDropAdapter.xml
@@ -0,0 +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.egit.ui.internal.clone.GitCloneDropAdapter">
+ <property name="event.topics" value="org/eclipse/e4/ui/LifeCycle/appStartupComplete"/>
+ <service>
+ <provide interface="org.osgi.service.event.EventHandler"/>
+ </service>
+ <implementation class="org.eclipse.egit.ui.internal.clone.GitCloneDropAdapter"/>
+</scr:component> \ No newline at end of file
diff --git a/org.eclipse.egit.ui/build.properties b/org.eclipse.egit.ui/build.properties
index 855348773..b0287adc4 100644
--- a/org.eclipse.egit.ui/build.properties
+++ b/org.eclipse.egit.ui/build.properties
@@ -8,6 +8,7 @@ bin.includes = META-INF/,\
plugin.properties,\
.options,\
css/,\
- schema/
+ schema/,\
+ OSGI-INF/
src.includes = about.html,\
icons/
diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml
index fe646c095..856613425 100644
--- a/org.eclipse.egit.ui/plugin.xml
+++ b/org.eclipse.egit.ui/plugin.xml
@@ -7249,10 +7249,4 @@
</variable>
</sourceProvider>
</extension>
- <extension
- point="org.eclipse.ui.startup">
- <startup
- class="org.eclipse.egit.ui.internal.clone.GitCloneDropAdapter">
- </startup>
- </extension>
</plugin>
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneDropAdapter.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneDropAdapter.java
index f293ab6f7..8d7c01f17 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneDropAdapter.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneDropAdapter.java
@@ -19,6 +19,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.e4.ui.workbench.UIEvents;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.internal.repository.tree.command.CloneCommand;
import org.eclipse.jface.util.Util;
@@ -39,7 +40,6 @@ import org.eclipse.ui.IPartListener2;
import org.eclipse.ui.IPartService;
import org.eclipse.ui.IPerspectiveDescriptor;
import org.eclipse.ui.IPerspectiveListener;
-import org.eclipse.ui.IStartup;
import org.eclipse.ui.IWindowListener;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
@@ -47,13 +47,19 @@ import org.eclipse.ui.IWorkbenchPartReference;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.UIJob;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventConstants;
+import org.osgi.service.event.EventHandler;
/**
* Adapter to listen for any Drag and Drop operations that transfer a valid git
* URL. If it goes through the URL parser correctly, a Clone Git Repo wizard
* will appear and be populated.
*/
-public class GitCloneDropAdapter implements IStartup {
+@Component(property = EventConstants.EVENT_TOPIC + '='
+ + UIEvents.UILifeCycle.APP_STARTUP_COMPLETE)
+public class GitCloneDropAdapter implements EventHandler {
private static final int[] PREFERRED_DROP_OPERATIONS = { DND.DROP_DEFAULT,
DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK };
@@ -68,7 +74,7 @@ public class GitCloneDropAdapter implements IStartup {
private Transfer[] transferAgents;
@Override
- public void earlyStartup() {
+ public void handleEvent(Event event) {
UIJob registerJob = new UIJob(PlatformUI.getWorkbench().getDisplay(),
"Git Clone DND Initialization") { //$NON-NLS-1$
{

Back to the top