Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2016-03-22 20:38:51 -0400
committerMatthias Sohn2016-04-02 19:46:10 -0400
commit1546ceda95e39e7e43a4b7b821b0ce37eed34db0 (patch)
tree038605302a51291ec242ac22d82eb5cb4f716091
parentae26a5b3cf07a41ead52f27791d5c1f82325cfa5 (diff)
downloadegit-1546ceda95e39e7e43a4b7b821b0ce37eed34db0.tar.gz
egit-1546ceda95e39e7e43a4b7b821b0ce37eed34db0.tar.xz
egit-1546ceda95e39e7e43a4b7b821b0ce37eed34db0.zip
Move EclipseAuthenticator and EclipseProxySelector to egit.core
These classes don't have any UI dependencies hence move them down to the org.eclipse.egit.core bundle. Change-Id: I2da6c99bc32f155ad7b9bec21aac0fb0942a595b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.core/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java18
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseAuthenticator.java (renamed from org.eclipse.egit.ui/src/org/eclipse/egit/ui/EclipseAuthenticator.java)2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseProxySelector.java (renamed from org.eclipse.egit.ui/src/org/eclipse/egit/ui/EclipseProxySelector.java)2
-rw-r--r--org.eclipse.egit.ui.test/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.egit.ui/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java17
7 files changed, 24 insertions, 22 deletions
diff --git a/org.eclipse.egit.core/META-INF/MANIFEST.MF b/org.eclipse.egit.core/META-INF/MANIFEST.MF
index f474546d6..ca683dafc 100644
--- a/org.eclipse.egit.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.egit.core/META-INF/MANIFEST.MF
@@ -41,7 +41,8 @@ Export-Package: org.eclipse.egit.core;version="4.3.0";
org.eclipse.egit.core.synchronize.dto;version="4.3.0";x-friends:="org.eclipse.egit.ui"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Import-Package: com.jcraft.jsch;bundle-version="[0.1.37,0.2.0)",
+Import-Package: com.jcraft.jsch;bundle-version="[0.1.37,0.2.0)",
+ org.eclipse.core.net.proxy;bundle-version="[1.1.0,2.0.0)",
org.eclipse.jgit.annotations;version="[4.3.0,4.4.0)",
org.eclipse.jgit.api;version="[4.3.0,4.4.0)",
org.eclipse.jgit.api.errors;version="[4.3.0,4.4.0)",
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java
index aae49aca2..8bee0b46e 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java
@@ -9,6 +9,8 @@ package org.eclipse.egit.core;
import java.io.File;
import java.io.IOException;
+import java.net.Authenticator;
+import java.net.ProxySelector;
import java.text.MessageFormat;
import java.util.Collection;
import java.util.Collections;
@@ -21,6 +23,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.net.proxy.IProxyService;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
@@ -180,6 +183,8 @@ public class Activator extends Plugin implements DebugOptionsListener {
props);
setupSSH(context);
+ setupProxy(context);
+
repositoryCache = new RepositoryCache();
indexDiffCache = new IndexDiffCache();
try {
@@ -210,6 +215,19 @@ public class Activator extends Plugin implements DebugOptionsListener {
}
}
+ @SuppressWarnings("unchecked")
+ private void setupProxy(final BundleContext context) {
+ final ServiceReference proxy;
+
+ proxy = context.getServiceReference(IProxyService.class.getName());
+ if (proxy != null) {
+ ProxySelector.setDefault(new EclipseProxySelector(
+ (IProxyService) context.getService(proxy)));
+ Authenticator.setDefault(new EclipseAuthenticator(
+ (IProxyService) context.getService(proxy)));
+ }
+ }
+
private void registerPreDeleteResourceChangeListener() {
if (preDeleteProjectListener == null) {
preDeleteProjectListener = new IResourceChangeListener() {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/EclipseAuthenticator.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseAuthenticator.java
index 0aebe09c1..5d95215b0 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/EclipseAuthenticator.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseAuthenticator.java
@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
-package org.eclipse.egit.ui;
+package org.eclipse.egit.core;
import java.net.Authenticator;
import java.net.InetAddress;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/EclipseProxySelector.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseProxySelector.java
index 156dd8c92..7f66803e9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/EclipseProxySelector.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseProxySelector.java
@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
-package org.eclipse.egit.ui;
+package org.eclipse.egit.core;
import java.io.IOException;
import java.net.InetAddress;
diff --git a/org.eclipse.egit.ui.test/META-INF/MANIFEST.MF b/org.eclipse.egit.ui.test/META-INF/MANIFEST.MF
index 88c0eac8a..14979fa7f 100644
--- a/org.eclipse.egit.ui.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.egit.ui.test/META-INF/MANIFEST.MF
@@ -17,7 +17,8 @@ Require-Bundle: org.apache.log4j;bundle-version="[1.0.0,2.0.0)",
org.mockito;bundle-version="[1.8.0,1.9.0)",
org.objenesis;bundle-version="[1.0.0,2.0.0)",
org.eclipse.jdt.launching;bundle-version="[3.8.0,4.0.0)"
-Import-Package: org.eclipse.egit.core.test;version="[4.3.0,4.4.0)",
+Import-Package: org.eclipse.core.net.proxy;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.egit.core.test;version="[4.3.0,4.4.0)",
org.eclipse.egit.gitflow;version="[4.3.0,4.4.0)",
org.eclipse.egit.gitflow.op;version="[4.3.0,4.4.0)",
org.eclipse.egit.gitflow.ui;version="[4.3.0,4.4.0)",
diff --git a/org.eclipse.egit.ui/META-INF/MANIFEST.MF b/org.eclipse.egit.ui/META-INF/MANIFEST.MF
index 8f634bc7c..e3e15ad8a 100644
--- a/org.eclipse.egit.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.egit.ui/META-INF/MANIFEST.MF
@@ -9,7 +9,6 @@ Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.1.0,2.0.0)",
org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.net;bundle-version="[1.1.0,2.0.0)",
org.eclipse.core.variables;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.team.core;bundle-version="[3.6.100,4.0.0)",
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
index 67c0eadcb..79b4c1941 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
@@ -15,8 +15,6 @@ package org.eclipse.egit.ui;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
-import java.net.Authenticator;
-import java.net.ProxySelector;
import java.util.ArrayList;
import java.util.Dictionary;
import java.util.Hashtable;
@@ -25,7 +23,6 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
-import org.eclipse.core.net.proxy.IProxyService;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
@@ -73,7 +70,6 @@ import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.ui.statushandlers.StatusManager;
import org.eclipse.ui.themes.ITheme;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
/**
* This is a plugin singleton mostly controlling logging.
@@ -309,7 +305,6 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
context.registerService(DebugOptionsListener.class.getName(), this,
props);
- setupProxy(context);
setupRepoChangeScanner();
setupRepoIndexRefresh();
setupFocusHandling();
@@ -680,18 +675,6 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
rcs.schedule(RepositoryChangeScanner.REPO_SCAN_INTERVAL);
}
- private void setupProxy(final BundleContext context) {
- final ServiceReference proxy;
-
- proxy = context.getServiceReference(IProxyService.class.getName());
- if (proxy != null) {
- ProxySelector.setDefault(new EclipseProxySelector(
- (IProxyService) context.getService(proxy)));
- Authenticator.setDefault(new EclipseAuthenticator(
- (IProxyService) context.getService(proxy)));
- }
- }
-
@Override
public void stop(final BundleContext context) throws Exception {
if (refreshHandle != null) {

Back to the top