View | Details | Raw Unified | Return to bug 248926 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/ShowInAction.java (-1 / +2 lines)
Lines 122-134 Link Here
122
        if (source != null) {
122
        if (source != null) {
123
            ShowInContext context = source.getShowInContext();
123
            ShowInContext context = source.getShowInContext();
124
            if (context != null) {
124
            if (context != null) {
125
            	context.setPart(sourcePart);
125
                return context;
126
                return context;
126
            }
127
            }
127
        } else if (sourcePart instanceof IEditorPart) {
128
        } else if (sourcePart instanceof IEditorPart) {
128
            Object input = ((IEditorPart) sourcePart).getEditorInput();
129
            Object input = ((IEditorPart) sourcePart).getEditorInput();
129
            ISelectionProvider sp = sourcePart.getSite().getSelectionProvider();
130
            ISelectionProvider sp = sourcePart.getSite().getSelectionProvider();
130
            ISelection sel = sp == null ? null : sp.getSelection();
131
            ISelection sel = sp == null ? null : sp.getSelection();
131
            return new ShowInContext(input, sel);
132
            return new ShowInContext(input, sel, sourcePart);
132
        }
133
        }
133
        return null;
134
        return null;
134
    }
135
    }
(-)Eclipse UI/org/eclipse/ui/part/ShowInContext.java (+28 lines)
Lines 12-17 Link Here
12
package org.eclipse.ui.part;
12
package org.eclipse.ui.part;
13
13
14
import org.eclipse.jface.viewers.ISelection;
14
import org.eclipse.jface.viewers.ISelection;
15
import org.eclipse.ui.IWorkbenchPart;
15
16
16
/**
17
/**
17
 * Carries the context for the Show In action.
18
 * Carries the context for the Show In action.
Lines 29-34 Link Here
29
30
30
    private ISelection selection;
31
    private ISelection selection;
31
32
33
	private IWorkbenchPart part;
34
32
    /**
35
    /**
33
     * Constructs a new <code>ShowInContext</code> with the given input and 
36
     * Constructs a new <code>ShowInContext</code> with the given input and 
34
     * selection.
37
     * selection.
Lines 42-47 Link Here
42
    }
45
    }
43
46
44
    /**
47
    /**
48
     * @param input the input or <code>null</code> 
49
     * @param selection the selection or <code>null</code>
50
	 * @param part the part of <code>null</code>
51
	 */
52
	public ShowInContext(Object input, ISelection selection,
53
			IWorkbenchPart part) {
54
		this(input, selection);
55
		setPart(part);
56
	}
57
58
	/**
45
     * Returns the input, or <code>null</code> to indicate no input
59
     * Returns the input, or <code>null</code> to indicate no input
46
     * 
60
     * 
47
     * @return the input or <code>null</code>.
61
     * @return the input or <code>null</code>.
Lines 77-80 Link Here
77
        this.selection = selection;
91
        this.selection = selection;
78
    }
92
    }
79
93
94
	/**
95
	 * @return Returns the part, or <code>null</code> to indicate no part has been set.
96
	 */
97
	public IWorkbenchPart getPart() {
98
		return part;
99
	}
100
101
	/**
102
	 * @param part The part to set, or <code>null</code> to indicate no part.
103
	 */
104
	public void setPart(IWorkbenchPart part) {
105
		this.part = part;
106
	}
107
80
}
108
}

Return to bug 248926