From d92ac7cbd9e05b5317ef6270eff21aebb3d7f60b Mon Sep 17 00:00:00 2001 From: Radoslav Gerganov Date: Tue, 6 May 2008 09:42:52 +0000 Subject: [PATCH] [229725] Right click popup menu inside Local Shell view has two copy entries --- .../ui/view/SystemViewRemoteErrorAdapter.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemViewRemoteErrorAdapter.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemViewRemoteErrorAdapter.java index bb5138db6ec..cdc320f1135 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemViewRemoteErrorAdapter.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemViewRemoteErrorAdapter.java @@ -13,10 +13,13 @@ * * Contributors: * David McKnight (IBM) - [216252] [nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible + * Radoslav Gerganov (ProSyst) - [229725] Right click popup menu inside Local Shell view has two copy entries *******************************************************************************/ package org.eclipse.rse.internal.shells.ui.view; +import java.util.Iterator; + import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.rse.internal.shells.ui.ShellResources; import org.eclipse.rse.internal.ui.view.SystemViewResources; @@ -41,8 +44,16 @@ public class SystemViewRemoteErrorAdapter extends SystemViewRemoteOutputAdapter */ public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup) { - super.addActions(menu, selection, shell, menuGroup); - + Iterator iter = selection.iterator(); + // check if the selection contains only IRemoteError objects + while (iter.hasNext()) { + Object current = iter.next(); + if (!(current instanceof IRemoteError)) { + return; + } + } + // add the same context menu actions as for IRemoteOutput + super.addActions(menu, selection, shell, menuGroup); } public IPropertyDescriptor[] getUniquePropertyDescriptors()