diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java index 8fe116539ac..6cf8db1624b 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java @@ -352,6 +352,11 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * Connect to the remote system. Does not force a prompt for a password. */ public void connect() throws Exception; + + /** + * Connect to the remote system from a background job + */ + public void connect(IProgressMonitor monitor) throws Exception; /** * Connect to the remote system, optionally forcing a signon prompt even if the password diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java index 717b33129a2..f3fef31b1f1 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java @@ -2357,6 +2357,49 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS } } + /** + * Required for Bug 176603 + */ + public void connect(IProgressMonitor monitor) throws Exception + { + if (!isConnected()) + { + String msg = null; + + msg = SubSystemConfiguration.getConnectingMessage(getHostName(), getConnectorService().getPort()); + SystemBasePlugin.logInfo(msg); + monitor.beginTask(msg, 10); + + final Exception[] exception=new Exception[1]; + exception[0]=null; + Display.getDefault().syncExec(new Runnable() { + public void run() { + try { + promptForPassword(); + } catch(Exception e) { + exception[0]=e; + } + } + }); + + try { + getConnectorService().connect(monitor); + } catch(Exception e) { + e.printStackTrace(); + } + if (isConnected()) { + final SubSystem ss = this; + //Notify connect status change + Display.getDefault().asyncExec(new Runnable() { + public void run() { + RSEUIPlugin.getTheSystemRegistry().connectedStatusChange(ss, true, false); + } + }); + } + monitor.done(); + } + } + /** * Connect to the remote system, optionally forcing a signon prompt even if the password * is cached in memory or on disk.