01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.part;
11:
12: import org.eclipse.jface.viewers.ISelection;
13:
14: /**
15: * Carries the context for the Show In action.
16: * The default implementation carries an input and a selection.
17: * Subclasses may extend.
18: *
19: * @see IShowInSource
20: * @see IShowInTarget
21: *
22: * @since 2.1
23: */
24: public class ShowInContext {
25:
26: private Object input;
27:
28: private ISelection selection;
29:
30: /**
31: * Constructs a new <code>ShowInContext</code> with the given input and
32: * selection.
33: *
34: * @param input the input or <code>null</code>
35: * @param selection the selection or <code>null</code>
36: */
37: public ShowInContext(Object input, ISelection selection) {
38: setInput(input);
39: setSelection(selection);
40: }
41:
42: /**
43: * Returns the input, or <code>null</code> to indicate no input
44: *
45: * @return the input or <code>null</code>.
46: */
47: public Object getInput() {
48: return input;
49: }
50:
51: /**
52: * Returns the selection, or <code>null</code> to indicate no selection.
53: *
54: * @return the selection or <code>null</code>
55: */
56: public ISelection getSelection() {
57: return selection;
58: }
59:
60: /**
61: * Sets the input, or <code>null</code> to indicate no input.
62: *
63: * @param input the input or <code>null</code>
64: */
65: public void setInput(Object input) {
66: this .input = input;
67: }
68:
69: /**
70: * Sets the selection, or <code>null</code> to indicate no selection.
71: *
72: * @param selection the selection or <code>null</code>
73: */
74: public void setSelection(ISelection selection) {
75: this.selection = selection;
76: }
77:
78: }
|