1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Apply patch for bug 150929: handle supportsUserId() properly

This commit is contained in:
Martin Oberhuber 2006-07-18 11:48:56 +00:00
parent 090f1b7bae
commit f355260209
3 changed files with 21 additions and 7 deletions

View file

@ -58,9 +58,7 @@ public class DaytimeSubsystemConfiguration extends ServiceSubSystemConfiguration
return false; return false;
} }
public boolean supportsUserId() { public boolean supportsUserId() {
// TODO for now, we have to connect in order to pass the hostname to the service return false;
// This should not be necessary in an ideal world
return true;
} }
public boolean isFactoryFor(Class subSystemType) { public boolean isFactoryFor(Class subSystemType) {
return DaytimeSubSystem.class.equals(subSystemType); return DaytimeSubSystem.class.equals(subSystemType);

View file

@ -100,6 +100,13 @@ public class DeveloperSubSystemConfiguration extends SubSystemConfiguration {
return RSESamplesPlugin.getResourceString("property.type.devrfilter"); //$NON-NLS-1$ return RSESamplesPlugin.getResourceString("property.type.devrfilter"); //$NON-NLS-1$
} }
/* (non-Javadoc)
* @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsUserId()
*/
public boolean supportsUserId() {
return false;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchProperties(org.eclipse.rse.model.IHost) * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchProperties(org.eclipse.rse.model.IHost)
*/ */

View file

@ -238,7 +238,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
public void setSubSystemConfiguration(ISubSystemConfiguration ssf) public void setSubSystemConfiguration(ISubSystemConfiguration ssf)
{ {
parentSubSystemFactory = ssf; parentSubSystemFactory = ssf;
supportsConnecting = ssf.supportsUserId(); supportsConnecting = ssf.supportsSubSystemConnect();
//System.out.println("subsystem supports connecting? " + supportsConnecting); //System.out.println("subsystem supports connecting? " + supportsConnecting);
} }
/** /**
@ -1663,7 +1663,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
protected boolean implicitConnect(boolean isConnectOperation, IProgressMonitor mon, String msg, int totalWorkUnits) throws SystemMessageException, InvocationTargetException, InterruptedException protected boolean implicitConnect(boolean isConnectOperation, IProgressMonitor mon, String msg, int totalWorkUnits) throws SystemMessageException, InvocationTargetException, InterruptedException
{ {
boolean didConnection = false; boolean didConnection = false;
if (doConnection && !isConnected())// caller wants to do connection first as part operation if ( doConnection && !isConnected())// caller wants to do connection first as part operation
{ {
if (isOffline() || (supportsCaching() && getCacheManager().isRestoreFromMemento())) if (isOffline() || (supportsCaching() && getCacheManager().isRestoreFromMemento()))
{ {
@ -2543,7 +2543,9 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
if (runnableContext instanceof ProgressMonitorDialog) { if (runnableContext instanceof ProgressMonitorDialog) {
((ProgressMonitorDialog) runnableContext).setCancelable(true); ((ProgressMonitorDialog) runnableContext).setCancelable(true);
} }
getConnectorService().promptForPassword(shell, forcePrompt); // prompt for userid and password if (getSubSystemConfiguration().supportsUserId()) {
getConnectorService().promptForPassword(shell, forcePrompt); // prompt for userid and password
}
ConnectJob job = new ConnectJob(); ConnectJob job = new ConnectJob();
scheduleJob(job, null, shell != null); scheduleJob(job, null, shell != null);
IStatus status = job.getResult(); IStatus status = job.getResult();
@ -2579,6 +2581,13 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
doConnection = true; // this gets handled later when it comes time to connect doConnection = true; // this gets handled later when it comes time to connect
return true; return true;
} }
else if (!getSubSystemConfiguration().supportsUserId())
{
// subsystem needs no user id so dont bother prompting
doConnection = true; // this gets handled later when it comes time to connect
return true;
}
try try
{ {