### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.shells.ui Index: src/org/eclipse/rse/internal/shells/ui/actions/SystemCommandAction.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/actions/SystemCommandAction.java,v retrieving revision 1.13 diff -u -r1.13 SystemCommandAction.java --- src/org/eclipse/rse/internal/shells/ui/actions/SystemCommandAction.java 28 Feb 2008 22:12:16 -0000 1.13 +++ src/org/eclipse/rse/internal/shells/ui/actions/SystemCommandAction.java 25 Apr 2008 19:07:41 -0000 @@ -19,6 +19,7 @@ * Kevin Doyle (IBM) - [187083] Launch Shell action available on folders inside virtual files * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible * David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared + * Anna Dushistova (MontaVista) - [149285] [ssh] multiple prompts and errors in case of incorrect username ********************************************************************************/ package org.eclipse.rse.internal.shells.ui.actions; @@ -29,6 +30,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.resource.ImageDescriptor; @@ -123,6 +125,9 @@ catch (SystemMessageException e) { SystemMessageDialog.displayMessage(e); } + catch (OperationCanceledException e) { + //do nothing--it's user's action + } catch (Exception e) { SystemBasePlugin.logError( e.getLocalizedMessage()!=null ? e.getLocalizedMessage() : e.getClass().getName(), @@ -135,6 +140,7 @@ public class PromptForPassword implements Runnable { public SubSystem _ss; + private boolean connectionCancelled=false; public PromptForPassword(SubSystem ss) { _ss = ss; @@ -148,9 +154,19 @@ } catch (Exception e) { - + if(e instanceof OperationCanceledException){ + setConnectionCancelled(true); + } } } + + public void setConnectionCancelled(boolean connectionCancelled) { + this.connectionCancelled = connectionCancelled; + } + + public boolean isConnectionCancelled() { + return connectionCancelled; + } } public class UpdateRegistry implements Runnable @@ -615,9 +631,13 @@ { Display dis = Display.getDefault(); - dis.syncExec(new PromptForPassword(ss)); - ss.getConnectorService().connect(monitor); - dis.asyncExec(new UpdateRegistry(ss)); + PromptForPassword passPrompt = new PromptForPassword(ss); + dis.syncExec(passPrompt); + if(!passPrompt.isConnectionCancelled()){ + ss.getConnectorService().connect(monitor); + dis.asyncExec(new UpdateRegistry(ss)); + }else + throw new OperationCanceledException(); } return true; }