From bf65ff0dec92c0e02a3c4b6329b5d4a569d786e0 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Fri, 29 Jun 2007 14:15:54 +0000 Subject: [PATCH] [165680] - fix for "Show in Remote Shell View" does not work --- .../actions/SystemShowInShellViewAction.java | 3 ++- .../shells/ui/view/CommandsViewWorkbook.java | 20 ++++++++++++++++++- .../ui/view/SystemCommandsViewPart.java | 13 ++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/actions/SystemShowInShellViewAction.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/actions/SystemShowInShellViewAction.java index c3806ed46d3..d6c64845a0f 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/actions/SystemShowInShellViewAction.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/actions/SystemShowInShellViewAction.java @@ -12,7 +12,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [165680] "Show in Remote Shell View" does not work *******************************************************************************/ package org.eclipse.rse.internal.shells.ui.actions; @@ -53,6 +53,7 @@ public class SystemShowInShellViewAction extends SystemBaseShellAction { IRemoteCommandShell cmdShell = (IRemoteCommandShell)_selected.get(i); viewPart.updateOutput(cmdShell); + viewPart.showPageFor(cmdShell); // for defect 165680 } } } diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewWorkbook.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewWorkbook.java index 0e5ad0d3e23..646683f5c33 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewWorkbook.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewWorkbook.java @@ -12,7 +12,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [165680] "Show in Remote Shell View" does not work *******************************************************************************/ package org.eclipse.rse.internal.shells.ui.view; @@ -128,6 +128,24 @@ public class CommandsViewWorkbook extends Composite { _folder.setFocus(); } + + /** + * For defect 165680, needed to change the active tab + * @param root the shell to show + */ + public void showPageFor(IRemoteCommandShell root) + { + for (int i = 0; i < _folder.getItemCount(); i++) + { + CTabItem item = _folder.getItem(i); + CommandsViewPage page = (CommandsViewPage) item.getData(); + if (page != null && root == page.getInput()) + { + _folder.setSelection(item); + } + + } + } public Object getInput() { diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java index 0a1e5969f94..7d7ec712f94 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java @@ -16,6 +16,7 @@ * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [174945] Remove obsolete icons from rse.shells.ui * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() + * David McKnight (IBM) - [165680] "Show in Remote Shell View" does not work ********************************************************************************/ package org.eclipse.rse.internal.shells.ui.view; @@ -627,6 +628,18 @@ public class SystemCommandsViewPart updateActionStates(); } } + + /** + * For defect 165680, needed to change the active tab + * @param root the shell to show + */ + public void showPageFor(IRemoteCommandShell root) + { + if (root != null && _folder != null) + { + _folder.showPageFor(root); + } + } public void setInput(IAdaptable object) {