directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r823086 - in /directory/studio/trunk/rcp: pom.xml src/main/java/org/apache/directory/studio/ApplicationWorkbenchAdvisor.java
Date Thu, 08 Oct 2009 07:59:34 GMT
Author: seelmann
Date: Thu Oct  8 07:59:34 2009
New Revision: 823086

URL: http://svn.apache.org/viewvc?rev=823086&view=rev
Log:
Fix for DIRSTUDIO-499 (SOCKS proxy settings not used on startup):
o Activate the proxy service when starting up the RCP application

Modified:
    directory/studio/trunk/rcp/pom.xml
    directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/ApplicationWorkbenchAdvisor.java

Modified: directory/studio/trunk/rcp/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/pom.xml?rev=823086&r1=823085&r2=823086&view=diff
==============================================================================
--- directory/studio/trunk/rcp/pom.xml (original)
+++ directory/studio/trunk/rcp/pom.xml Thu Oct  8 07:59:34 2009
@@ -132,7 +132,8 @@
  org.eclipse.ui.intro,
  org.eclipse.core.resources,
  org.eclipse.ui.ide,
- org.eclipse.core.filesystem
+ org.eclipse.core.filesystem,
+ org.eclipse.core.net
             </Require-Bundle>
             <Export-Package>!*</Export-Package>
             <Import-Package>!</Import-Package>
@@ -236,6 +237,11 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
+      <groupId>org.eclipse.core</groupId>
+      <artifactId>net</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
       <groupId>org.eclipse.equinox</groupId>
       <artifactId>app</artifactId>
       <scope>provided</scope>

Modified: directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/ApplicationWorkbenchAdvisor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/ApplicationWorkbenchAdvisor.java?rev=823086&r1=823085&r2=823086&view=diff
==============================================================================
--- directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/ApplicationWorkbenchAdvisor.java
(original)
+++ directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/ApplicationWorkbenchAdvisor.java
Thu Oct  8 07:59:34 2009
@@ -21,6 +21,8 @@
 package org.apache.directory.studio;
 
 
+import org.eclipse.core.net.proxy.IProxyService;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.TrayDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
@@ -32,6 +34,8 @@
 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
 import org.eclipse.ui.application.WorkbenchAdvisor;
 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceReference;
 
 
 /**
@@ -120,4 +124,28 @@
         return true;
     }
 
+
+    @Override
+    public void postStartup()
+    {
+        super.postStartup();
+        activateProxyService();
+    }
+
+
+    /**
+     * Activate the proxy service, this sets the relevant system properties.
+     */
+    private void activateProxyService()
+    {
+        Bundle bundle = Platform.getBundle( "org.eclipse.ui.ide" ); //$NON-NLS-1$
+        if ( bundle != null )
+        {
+            ServiceReference ref = bundle.getBundleContext().getServiceReference( IProxyService.class.getName()
);
+            if ( ref != null )
+            {
+                bundle.getBundleContext().getService( ref );
+            }
+        }
+    }
 }



Mime
View raw message