mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-09 01:55:24 +02:00
[176603] new connect(IProgressMonitor) api for ISubsystem
This commit is contained in:
parent
615e181bec
commit
f3ad795632
2 changed files with 48 additions and 0 deletions
|
@ -352,6 +352,11 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
|
||||||
* Connect to the remote system. Does not force a prompt for a password.
|
* Connect to the remote system. Does not force a prompt for a password.
|
||||||
*/
|
*/
|
||||||
public void connect() throws Exception;
|
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
|
* Connect to the remote system, optionally forcing a signon prompt even if the password
|
||||||
|
|
|
@ -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
|
* Connect to the remote system, optionally forcing a signon prompt even if the password
|
||||||
* is cached in memory or on disk.
|
* is cached in memory or on disk.
|
||||||
|
|
Loading…
Add table
Reference in a new issue