KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > contexts > IContextManager


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.contexts;
13
14 import java.util.SortedSet JavaDoc;
15
16 /**
17  * <p>
18  * A context manager tracks the sets of defined and enabled contexts within the
19  * application. The manager sends notification events to listeners when these
20  * sets change. It is also possible to retrieve any given context with its
21  * identifier.
22  * </p>
23  * <p>
24  * This interface is not intended to be extended or implemented by clients.
25  * </p>
26  *
27  * @since 3.0
28  * @deprecated Please use the "org.eclipse.core.commands" plug-in instead.
29  * @see org.eclipse.core.commands.contexts.ContextManager
30  */

31 public interface IContextManager {
32
33     /**
34      * Registers an instance of <code>IContextManagerListener</code> to listen
35      * for changes to properties of this instance.
36      *
37      * @param contextManagerListener
38      * the instance to register. Must not be <code>null</code>. If
39      * an attempt is made to register an instance which is already
40      * registered with this instance, no operation is performed.
41      */

42     void addContextManagerListener(
43             IContextManagerListener contextManagerListener);
44
45     /**
46      * Returns an instance of <code>IContext</code> given an identifier.
47      *
48      * @param contextId
49      * an identifier. Must not be <code>null</code>
50      * @return an instance of <code>IContext</code>.
51      */

52     IContext getContext(String JavaDoc contextId);
53
54     /**
55      * Returns the set of identifiers to defined contexts. The set is sorted by
56      * the depth of the context within the tree of contexts. So, for example,
57      * a child context will always appear before its parent.
58      * <p>
59      * Notification is sent to all registered listeners if this property
60      * changes.
61      * </p>
62      *
63      * @return the set of identifiers to defined contexts. This set may be
64      * empty, but is guaranteed not to be <code>null</code>. If this
65      * set is not empty, it is guaranteed to only contain instances of
66      * <code>String</code>.
67      */

68     SortedSet JavaDoc getDefinedContextIds();
69
70     /**
71      * Returns the set of identifiers to enabled contexts. The set is sorted by
72      * the depth of the context within the tree of contexts. So, for example,
73      * a child context will always appear before its parent.
74      * <p>
75      * Notification is sent to all registered listeners if this property
76      * changes.
77      * </p>
78      *
79      * @return the set of identifiers to enabled contexts. This set may be
80      * empty, but is guaranteed not to be <code>null</code>. If this
81      * set is not empty, it is guaranteed to only contain instances of
82      * <code>String</code>.
83      */

84     SortedSet JavaDoc getEnabledContextIds();
85
86     /**
87      * Unregisters an instance of <code>IContextManagerListener</code>
88      * listening for changes to properties of this instance.
89      *
90      * @param contextManagerListener
91      * the instance to unregister. Must not be <code>null</code>.
92      * If an attempt is made to unregister an instance which is not
93      * already registered with this instance, no operation is
94      * performed.
95      */

96     void removeContextManagerListener(
97             IContextManagerListener contextManagerListener);
98 }
99
Popular Tags