diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemFetchOperation.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemFetchOperation.java index 77aaff938a6..5f253084cf0 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemFetchOperation.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemFetchOperation.java @@ -26,7 +26,12 @@ import org.eclipse.jface.action.IAction; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.core.subsystems.SubSystem; +import org.eclipse.rse.core.subsystems.SubSystem.ConnectJob; +import org.eclipse.rse.core.subsystems.SubSystem.ConnectJobNoShell; import org.eclipse.rse.ui.view.ISystemViewElementAdapter; +import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchSite; @@ -101,6 +106,29 @@ public class SystemFetchOperation extends JobChangeAdapter implements IRunnableW //handleErrors((IStatus[]) errors.toArray(new IStatus[errors.size()])); } + + public class PromptForPassword implements Runnable + { + public SubSystem _ss; + public PromptForPassword(SubSystem ss) + { + _ss = ss; + } + + public void run() + { + Shell shell = Display.getCurrent().getActiveShell(); + try + { + _ss.promptForPassword(shell); + } + catch (Exception e) + { + + } + } + } + /** * Subclasses must override this method to perform the operation. * Clients should never call this method directly. @@ -111,6 +139,22 @@ public class SystemFetchOperation extends JobChangeAdapter implements IRunnableW */ protected void execute(IProgressMonitor monitor) throws Exception, InterruptedException { + SubSystem ss = (SubSystem)_adapter.getSubSystem(_remoteObject); + synchronized (ss) + { + if (!ss.isConnected()) + { + + Display dis = Display.getDefault(); + dis.syncExec(new PromptForPassword(ss)); + + //ss.connect(monitor); + //ConnectJob conjob = ss.new ConnectJob(); + //conjob.run(monitor); + ss.getConnectorService().connect(monitor); + + } + } Object[] children = _adapter.getChildren(monitor, _remoteObject); _collector.add(children, monitor); monitor.done(); diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewLabelAndContentProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewLabelAndContentProvider.java index f45e69bcd24..2adfd483926 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewLabelAndContentProvider.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewLabelAndContentProvider.java @@ -243,7 +243,7 @@ public class SystemViewLabelAndContentProvider extends LabelProvider ISubSystem ss = adapter.getSubSystem(element); if (ss != null) { - if (ss.isConnected()) + // if (ss.isConnected()) { Object[] children = manager.getChildren(element); 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 2761d86eae9..51b2ad5b4c3 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 @@ -1347,6 +1347,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS } catch(InvocationTargetException exc) { + exc.printStackTrace(); monitor.done(); String excMsg = exc.getTargetException().getMessage(); if ((excMsg == null) || (excMsg.length()==0)) @@ -1599,7 +1600,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS /** * Represents the subsystem operation of connecting the subsystem to the remote machine. */ - protected class ConnectJob extends SubSystemOperationJob + public class ConnectJob extends SubSystemOperationJob { public ConnectJob() { @@ -2564,7 +2565,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS * monitor. * @param Shell parent shell used to show error message. Null means you will handle showing the error message. */ - protected boolean promptForPassword(Shell shell) throws Exception + public boolean promptForPassword(Shell shell) throws Exception { boolean ok = false; if (!supportsConnecting)