### Eclipse Workspace Patch 1.0 #P org.eclipse.ui.workbench Index: Eclipse UI/org/eclipse/ui/internal/ShowInAction.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowInAction.java,v retrieving revision 1.11 diff -u -r1.11 ShowInAction.java --- Eclipse UI/org/eclipse/ui/internal/ShowInAction.java 16 Mar 2007 18:00:32 -0000 1.11 +++ Eclipse UI/org/eclipse/ui/internal/ShowInAction.java 29 Sep 2008 11:26:09 -0000 @@ -122,13 +122,14 @@ if (source != null) { ShowInContext context = source.getShowInContext(); if (context != null) { + context.setPart(sourcePart); return context; } } else if (sourcePart instanceof IEditorPart) { Object input = ((IEditorPart) sourcePart).getEditorInput(); ISelectionProvider sp = sourcePart.getSite().getSelectionProvider(); ISelection sel = sp == null ? null : sp.getSelection(); - return new ShowInContext(input, sel); + return new ShowInContext(input, sel, sourcePart); } return null; } Index: Eclipse UI/org/eclipse/ui/part/ShowInContext.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/ShowInContext.java,v retrieving revision 1.7 diff -u -r1.7 ShowInContext.java --- Eclipse UI/org/eclipse/ui/part/ShowInContext.java 16 Mar 2007 18:00:34 -0000 1.7 +++ Eclipse UI/org/eclipse/ui/part/ShowInContext.java 29 Sep 2008 11:26:09 -0000 @@ -12,6 +12,7 @@ package org.eclipse.ui.part; import org.eclipse.jface.viewers.ISelection; +import org.eclipse.ui.IWorkbenchPart; /** * Carries the context for the Show In action. @@ -29,6 +30,8 @@ private ISelection selection; + private IWorkbenchPart part; + /** * Constructs a new ShowInContext with the given input and * selection. @@ -42,6 +45,19 @@ } /** + * @param input the input or null + * @param selection the selection or null + * @param part the part of null + * + * since 3.5 + */ + public ShowInContext(Object input, ISelection selection, + IWorkbenchPart part) { + this(input, selection); + setPart(part); + } + + /** * Returns the input, or null to indicate no input * * @return the input or null. @@ -77,4 +93,22 @@ this.selection = selection; } + /** + * @return Returns the part, or null to indicate no part has been set. + * + * since 3.5 + */ + public IWorkbenchPart getPart() { + return part; + } + + /** + * @param part The part to set, or null to indicate no part. + * + * since 3.5 + */ + public void setPart(IWorkbenchPart part) { + this.part = part; + } + }