From 87a2136876196a4d21aa96c33920ba73e76c73f9 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Tue, 3 Oct 2006 17:36:25 +0000 Subject: [PATCH] handle cancel connect when launching shell - Bug 158869 --- .../rse/shells/ui/actions/SystemCommandAction.java | 11 +++++++---- .../org/eclipse/rse/core/subsystems/SubSystem.java | 6 ++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemCommandAction.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemCommandAction.java index bcfb9fc9459..764eaefe44e 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemCommandAction.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemCommandAction.java @@ -489,10 +489,13 @@ public class SystemCommandAction extends SystemBaseAction else { cmdSubSystem.connect(); - SystemCommandsUI commandsUI = SystemCommandsUI.getInstance(); - SystemCommandsViewPart cmdsPart = commandsUI.activateCommandsView(); - IRemoteCommandShell cmd = cmdSubSystem.runShell( _selected); - cmdsPart.updateOutput(cmd); + if (cmdSubSystem.isConnected()) + { + SystemCommandsUI commandsUI = SystemCommandsUI.getInstance(); + SystemCommandsViewPart cmdsPart = commandsUI.activateCommandsView(); + IRemoteCommandShell cmd = cmdSubSystem.runShell( _selected); + cmdsPart.updateOutput(cmd); + } //showInView(cmd); } } 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 4836811d8e6..e0b507901e9 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 @@ -196,8 +196,14 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS { connect(false); } + catch (InterruptedException e) + { + return Status.CANCEL_STATUS; + + } catch (Exception e) { + e.printStackTrace(); String excMsg = e.getMessage(); if ((excMsg == null) || (excMsg.length()==0)) excMsg = "Exception " + e.getClass().getName();