KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > part > ShowInContext


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.ui.part;
13
14 import org.eclipse.jface.viewers.ISelection;
15
16 /**
17  * Carries the context for the Show In action.
18  * The default implementation carries an input and a selection.
19  * Subclasses may extend.
20  *
21  * @see IShowInSource
22  * @see IShowInTarget
23  *
24  * @since 2.1
25  */

26 public class ShowInContext {
27
28     private Object JavaDoc input;
29
30     private ISelection selection;
31
32     /**
33      * Constructs a new <code>ShowInContext</code> with the given input and
34      * selection.
35      *
36      * @param input the input or <code>null</code>
37      * @param selection the selection or <code>null</code>
38      */

39     public ShowInContext(Object JavaDoc input, ISelection selection) {
40         setInput(input);
41         setSelection(selection);
42     }
43
44     /**
45      * Returns the input, or <code>null</code> to indicate no input
46      *
47      * @return the input or <code>null</code>.
48      */

49     public Object JavaDoc getInput() {
50         return input;
51     }
52
53     /**
54      * Returns the selection, or <code>null</code> to indicate no selection.
55      *
56      * @return the selection or <code>null</code>
57      */

58     public ISelection getSelection() {
59         return selection;
60     }
61
62     /**
63      * Sets the input, or <code>null</code> to indicate no input.
64      *
65      * @param input the input or <code>null</code>
66      */

67     public void setInput(Object JavaDoc input) {
68         this.input = input;
69     }
70
71     /**
72      * Sets the selection, or <code>null</code> to indicate no selection.
73      *
74      * @param selection the selection or <code>null</code>
75      */

76     public void setSelection(ISelection selection) {
77         this.selection = selection;
78     }
79
80 }
81
Popular Tags