KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > search > ui > ISearchPageContainer


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 package org.eclipse.search.ui;
12
13 import org.eclipse.jface.operation.IRunnableContext;
14 import org.eclipse.jface.viewers.ISelection;
15
16 import org.eclipse.ui.IWorkingSet;
17
18 /**
19  * Offers client access to the search dialog.
20  * A search page can enable or disable the dialog's action
21  * button and get an operation context to perform the action.
22  * The dialog itself cannot be accessed directly.
23  * <p>
24  * This interface is not intended to be implemented by clients.
25  * </p>
26  */

27 public interface ISearchPageContainer {
28
29     /**
30      * Workspace scope (value <code>0</code>).
31      *
32      * @since 2.0
33      */

34     public static final int WORKSPACE_SCOPE= 0;
35
36     /**
37      * Selection scope (value <code>1</code>).
38      *
39      * @since 2.0
40      */

41     public static final int SELECTION_SCOPE= 1;
42
43     /**
44      * Working set scope (value <code>2</code>).
45      *
46      * @since 2.0
47      */

48     public static final int WORKING_SET_SCOPE= 2;
49
50     /**
51      * Current Project scope (value <code>3</code>).
52      *
53      * @since 3.0
54      */

55     public static final int SELECTED_PROJECTS_SCOPE= 3;
56
57     /**
58      * Returns the selection with which this container was opened.
59      *
60      * @return the selection passed to this container when it was opened
61      */

62     public ISelection getSelection();
63
64     /**
65      * Returns the context for the search operation.
66      * This context allows progress to be shown inside the search dialog.
67      *
68      * @return the <code>IRunnableContext</code> for the search operation
69      */

70     public IRunnableContext getRunnableContext();
71
72     /**
73      * Sets the enable state of the perform action button
74      * of this container.
75      *
76      * @param state <code>true</code> to enable the button which performs the action
77      */

78      public void setPerformActionEnabled(boolean state);
79
80     /**
81      * Returns search container's selected scope.
82      * The scope is WORKSPACE_SCOPE, SELECTED_PROJECTS_SCOPE, SELECTION_SCOPE or WORKING_SET_SCOPE.
83      *
84      * @return the selected scope
85      * @since 2.0
86      */

87     public int getSelectedScope();
88
89     /**
90      * Sets the selected scope of this search page container.
91      * The scope is WORKSPACE_SCOPE, SELECTED_PROJECTS_SCOPE, SELECTION_SCOPE or WORKING_SET_SCOPE.
92      * @param scope the newly selected scope
93      *
94      * @since 2.0
95      */

96     public void setSelectedScope(int scope);
97
98     /**
99      * Tells whether a valid scope is selected.
100      *
101      * @return a <code>true</code> if a valid scope is selected in this search page container
102      * @since 2.0
103      */

104     public boolean hasValidScope();
105
106     /**
107      * Returns the selected working sets of this container.
108      *
109      * @return an array with the selected working sets or <code>null</code> if the scope is not {@link #WORKING_SET_SCOPE}
110      * @since 2.0
111      */

112     public IWorkingSet[] getSelectedWorkingSets();
113
114     /**
115      * Sets the selected working sets of this container.
116      *
117      * @param workingSets an array of IWorkingSet
118      * @since 2.0
119      */

120     public void setSelectedWorkingSets(IWorkingSet[] workingSets);
121     
122     /**
123      * Returns the names of the enclosing projects if selected by the container or <code>null</code>
124      * if the scope is not {@link #SELECTED_PROJECTS_SCOPE}
125      *
126      * @return the names of the enclosing project or <code>null</code> if the scope is not {@link #SELECTED_PROJECTS_SCOPE}.
127      * @since 3.2
128      */

129     public String JavaDoc[] getSelectedProjectNames();
130     
131 }
132
Popular Tags