1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

[176603] new connect(IProgressMonitor) api for ISubsystem

This commit is contained in:
David McKnight 2007-04-02 17:13:12 +00:00
parent 615e181bec
commit f3ad795632
2 changed files with 48 additions and 0 deletions

View file

@ -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

View file

@ -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.