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

[176603] connect(IProgressMonitor, boolean forcePrompt)

This commit is contained in:
David McKnight 2007-04-10 16:26:03 +00:00
parent e321ca933f
commit f6e7310a3a
2 changed files with 29 additions and 3 deletions

View file

@ -27,7 +27,6 @@ import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.IPropertySet;
import org.eclipse.rse.core.model.IRSECallback;
import org.eclipse.rse.core.model.IRSEModelObject;
import org.eclipse.rse.core.model.IRSEPersistableContainer;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
@ -378,9 +377,20 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
* Connect to the remote system from a background job
*
* @param monitor the process monitor
*
* @deprecated use connect(IProgressMonitor, boolean)
*/
public void connect(IProgressMonitor monitor) throws Exception;
/**
* Connect to the remote system from a background job
*
* @param monitor the process monitor
* @param forcePrompt forces the prompt dialog to be displayed even if the password is currently
* in memory
*/
public void connect(IProgressMonitor monitor, boolean forcePrompt) throws Exception;
/**
* Connect to the remote system on a background job. The callback is

View file

@ -2382,8 +2382,22 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
/**
* Required for Bug 176603
*
* @deprecated
*/
public void connect(IProgressMonitor monitor) throws Exception
{
connect(monitor, false);
}
/**
* Connect to a remote system with a monitor.
* Required for Bug 176603
*
* @param monitor the progress monitor
* @param forcePrompt indicates whether to prompt even if password is in memory
*/
public void connect(IProgressMonitor monitor, boolean forcePrompt) throws Exception
{
if (!isConnected())
{
@ -2392,13 +2406,15 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
msg = SubSystemConfiguration.getConnectingMessage(getHostName(), getConnectorService().getPort());
SystemBasePlugin.logInfo(msg);
monitor.beginTask(msg, 10);
final boolean promptForPassword = forcePrompt;
final Exception[] exception=new Exception[1];
exception[0]=null;
Display.getDefault().syncExec(new Runnable() {
public void run() {
try {
promptForPassword();
try
{
promptForPassword(promptForPassword);
} catch(Exception e) {
exception[0]=e;
}