KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > ISources


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 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;
13
14 import org.eclipse.core.expressions.IEvaluationContext;
15
16 /**
17  * <p>
18  * A source is type of event change that can occur within the workbench. For
19  * example, the active workbench window can change, so it is considered a
20  * source. Workbench services can track changes to these sources, and thereby
21  * try to resolve conflicts between a variety of possible options. This is most
22  * commonly used for things like handlers and contexts.
23  * </p>
24  * <p>
25  * This interface defines the source that are known to the workbench at
26  * compile-time. These sources can be combined in a bit-wise fashion. So, for
27  * example, a <code>ACTIVE_PART | ACTIVE_CONTEXT</code> source includes change
28  * to both the active context and the active part.
29  * </p>
30  * <p>
31  * The values assigned to each source indicates its relative priority. The
32  * higher the value, the more priority the source is given in resolving
33  * conflicts. Another way to look at this is that the higher the value, the more
34  * "local" the source is to what the user is currently doing. This is similar
35  * to, but distinct from the concept of components. The nesting support provided
36  * by components represent only one source (<code>ACTIVE_SITE</code>) that
37  * the workbench understands.
38  * </p>
39  * <p>
40  * Note that for backward compatibility, we must reserve the lowest three bits
41  * for <code>Priority</code> instances using the old
42  * <code>HandlerSubmission</code> mechanism. This mechanism was used in
43  * Eclipse 3.0.
44  * </p>
45  * <p>
46  * <b>Note in 3.3:</b>
47  * </p>
48  * <p>
49  * Currently, source variables are not extensible by user plugins, and
50  * the number of bits available for resolving conflicts is limited. When
51  * the variable sources become user extensible a new conflict resolution
52  * mechanism will be implemented.
53  * </p>
54  * <p>
55  * This interface is not intended to be implemented or extended by clients.
56  * </p>
57  *
58  * @see org.eclipse.ui.ISourceProvider
59  * @since 3.1
60  */

61 public interface ISources {
62
63     /**
64      * The priority given to default handlers and handlers that are active
65      * across the entire workbench.
66      */

67     public static final int WORKBENCH = 0;
68
69     /**
70      * The priority given when the activation is defined by a handler submission
71      * with a legacy priority.
72      */

73     public static final int LEGACY_LEGACY = 1;
74
75     /**
76      * The priority given when the activation is defined by a handler submission
77      * with a low priority.
78      */

79     public static final int LEGACY_LOW = 1 << 1;
80
81     /**
82      * The priority given when the activation is defined by a handler submission
83      * with a medium priority.
84      */

85     public static final int LEGACY_MEDIUM = 1 << 2;
86
87     /**
88      * The priority given when the source includes a particular context.
89      */

90     public static final int ACTIVE_CONTEXT = 1 << 6;
91
92     /**
93      * The variable name for the active contexts. This is for use with the
94      * <code>ISourceProvider</code> and <code>IEvaluationContext</code>.
95      * @since 3.2
96      */

97     public static final String JavaDoc ACTIVE_CONTEXT_NAME = "activeContexts"; //$NON-NLS-1$
98

99     /**
100      * The priority given when the source includes a particular action set.
101      * @since 3.2
102      */

103     public static final int ACTIVE_ACTION_SETS = 1 << 8;
104
105     /**
106      * The variable name for the active action sets. This is for use with the
107      * {@link ISourceProvider} and {@link IEvaluationContext}.
108      * @since 3.2
109      */

110     public static final String JavaDoc ACTIVE_ACTION_SETS_NAME = "activeActionSets"; //$NON-NLS-1$
111

112     /**
113      * The priority given when the source includes the currently active shell.
114      */

115     public static final int ACTIVE_SHELL = 1 << 10;
116
117     /**
118      * The variable name for the active shell. This is for use with the
119      * <code>ISourceProvider</code> and <code>IEvaluationContext</code>.
120      */

121     public static final String JavaDoc ACTIVE_SHELL_NAME = "activeShell"; //$NON-NLS-1$
122

123     /**
124      * The priority given when the source includes the currently active
125      * workbench window shell.
126      * @since 3.2
127      */

128     public static final int ACTIVE_WORKBENCH_WINDOW_SHELL = 1 << 12;
129
130     /**
131      * The variable name for the active workbench window shell. This is for use
132      * with the <code>ISourceProvider</code> and
133      * <code>IEvaluationContext</code>.
134      * @since 3.2
135      */

136     public static final String JavaDoc ACTIVE_WORKBENCH_WINDOW_SHELL_NAME = "activeWorkbenchWindowShell"; //$NON-NLS-1$
137

138     /**
139      * The priority given when the source includes the currently active
140      * workbench window.
141      */

142     public static final int ACTIVE_WORKBENCH_WINDOW = 1 << 14;
143
144     /**
145      * The variable name for the active workbench window. This is for use with
146      * the <code>ISourceProvider</code> and <code>IEvaluationContext</code>.
147      */

148     public static final String JavaDoc ACTIVE_WORKBENCH_WINDOW_NAME = "activeWorkbenchWindow"; //$NON-NLS-1$
149

150     /**
151      * The priority given when the source includes subordinate properties of the currently active
152      * workbench window.
153      *
154      * @since 3.3
155      */

156     public static final int ACTIVE_WORKBENCH_WINDOW_SUBORDINATE = 1 << 15;
157     
158     /**
159      * The variable name for the coolbar visibility state of the active
160      * workbench window. This is for use with the <code>ISourceProvider</code>
161      * and <code>IEvaluationContext</code>.
162      *
163      * @since 3.3
164      */

165     public static final String JavaDoc ACTIVE_WORKBENCH_WINDOW_IS_COOLBAR_VISIBLE_NAME = ACTIVE_WORKBENCH_WINDOW_NAME
166             + ".isCoolbarVisible"; //$NON-NLS-1$
167

168     /**
169      * The variable name for the perspective bar visibility state of the active
170      * workbench window. This is for use with the <code>ISourceProvider</code>
171      * and <code>IEvaluationContext</code>.
172      *
173      * @since 3.3
174      */

175     public static final String JavaDoc ACTIVE_WORKBENCH_WINDOW_IS_PERSPECTIVEBAR_VISIBLE_NAME = ACTIVE_WORKBENCH_WINDOW_NAME
176             + ".isPerspectiveBarVisible"; //$NON-NLS-1$
177

178     /**
179      * The priority given when the source includes the active editor part.
180      */

181     public static final int ACTIVE_EDITOR = 1 << 16;
182
183     /**
184      * The variable name for the active editor part. This is for use with the
185      * <code>ISourceProvider</code> and <code>IEvaluationContext</code>.
186      * @since 3.2
187      */

188     public static final String JavaDoc ACTIVE_EDITOR_NAME = "activeEditor"; //$NON-NLS-1$
189

190     /**
191      * The priority given when the source includes the active editor identifier.
192      *
193      * @since 3.2
194      */

195     public static final int ACTIVE_EDITOR_ID = 1 << 18;
196
197     /**
198      * The variable name for the active editor identifier. This is for use with
199      * the <code>ISourceProvider</code> and <code>IEvaluationContext</code>.
200      *
201      * @since 3.2
202      */

203     public static final String JavaDoc ACTIVE_EDITOR_ID_NAME = "activeEditorId"; //$NON-NLS-1$
204

205     /**
206      * The priority given when the source includes the active part.
207      */

208     public static final int ACTIVE_PART = 1 << 20;
209
210     /**
211      * The variable name for the active part. This is for use with the
212      * <code>ISourceProvider</code> and <code>IEvaluationContext</code>.
213      */

214     public static final String JavaDoc ACTIVE_PART_NAME = "activePart"; //$NON-NLS-1$
215

216     /**
217      * The priority given when the source includes the active part id.
218      *
219      * @since 3.2
220      */

221     public static final int ACTIVE_PART_ID = 1 << 22;
222
223     /**
224      * The variable name for the active part id. This is for use with the
225      * <code>ISourceProvider</code> and <code>IEvaluationContext</code>.
226      *
227      * @since 3.2
228      */

229     public static final String JavaDoc ACTIVE_PART_ID_NAME = "activePartId"; //$NON-NLS-1$
230

231     /**
232      * The priority given when the source includes the active workbench site. In
233      * the case of nesting components, one should be careful to only activate
234      * the most nested component.
235      */

236     public static final int ACTIVE_SITE = 1 << 26;
237
238     /**
239      * The variable name for the active workbench site. This is for use with the
240      * <code>ISourceProvider</code> and <code>IEvaluationContext</code>.
241      */

242     public static final String JavaDoc ACTIVE_SITE_NAME = "activeSite"; //$NON-NLS-1$
243

244     /**
245      * The priority given when the source includes the current selection.
246      */

247     public static final int ACTIVE_CURRENT_SELECTION = 1 << 30;
248
249     /**
250      * The variable name for the active selection. This is for use with the
251      * <code>ISourceProvider</code> and <code>IEvaluationContext</code>.
252      * @since 3.2
253      */

254     public static final String JavaDoc ACTIVE_CURRENT_SELECTION_NAME = "selection"; //$NON-NLS-1$
255

256     /**
257      * The priority given when the source includes the current menu.
258      * @since 3.2
259      */

260     public static final int ACTIVE_MENU = 1 << 31;
261
262     /**
263      * The variable name for the active menu. This is for use with the
264      * {@link ISourceProvider} and {@link IEvaluationContext}.
265      * @since 3.2
266      */

267     public static final String JavaDoc ACTIVE_MENU_NAME = "activeMenu"; //$NON-NLS-1$
268

269     /**
270      * The variable name for the <b>local</b> selection, available while a
271      * context menu is visible.
272      *
273      * @since 3.3
274      */

275     public static final String JavaDoc ACTIVE_MENU_SELECTION_NAME = "activeMenuSelection"; //$NON-NLS-1$
276

277     /**
278      * The variable name for the <b>local</b> editor input which is sometimes
279      * available while a context menu is visible.
280      *
281      * @since 3.3
282      */

283     public static final String JavaDoc ACTIVE_MENU_EDITOR_INPUT_NAME = "activeMenuEditorInput"; //$NON-NLS-1$
284

285     /**
286      * The variable name for the active focus Control, when provided by the
287      * IFocusService.
288      *
289      * @since 3.3
290      */

291     public static final String JavaDoc ACTIVE_FOCUS_CONTROL_NAME = "activeFocusControl"; //$NON-NLS-1$
292

293     /**
294      * The variable name for the active focus Control id, when provided by the
295      * IFocusService.
296      *
297      * @since 3.3
298      */

299     public static final String JavaDoc ACTIVE_FOCUS_CONTROL_ID_NAME = "activeFocusControlId"; //$NON-NLS-1$
300
}
301
Popular Tags