|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.contexts.ContextManager
A context manager tracks the sets of defined and enabled contexts within the application. The manager sends notification events to listeners when these sets change. It is also possible to retrieve any given context with its identifier.
This class is not intended to be extended by clients.
Field Summary | |
---|---|
static boolean |
DEBUG
This flag can be set to true if the context manager should
print information to System.out when certain boundary
conditions occur. |
Constructor Summary | |
---|---|
ContextManager()
|
Method Summary | |
---|---|
void |
addActiveContext(String contextId)
Activates a context in this context manager. |
void |
addContextManagerListener(IContextManagerListener listener)
Adds a listener to this context manager. |
void |
contextChanged(ContextEvent contextEvent)
Notifies that one or more properties of an instance of IContext have changed. |
Set |
getActiveContextIds()
Returns the set of active context identifiers. |
Context |
getContext(String contextId)
Gets the context with the given identifier. |
Set |
getDefinedContextIds()
Returns the set of identifiers for those contexts that are defined. |
void |
removeActiveContext(String contextId)
Deactivates a context in this context manager. |
void |
removeContextManagerListener(IContextManagerListener listener)
Removes a listener from this context manager. |
void |
setActiveContextIds(Set activeContextIds)
Changes the set of active contexts for this context manager. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static boolean DEBUG
true
if the context manager should
print information to System.out
when certain boundary
conditions occur.
Constructor Detail |
public ContextManager()
Method Detail |
public final void addActiveContext(String contextId)
contextId
- The identifier of the context to activate; must not be
null
.public final void addContextManagerListener(IContextManagerListener listener)
listener
- The listener to attach; must not be null
.public final void contextChanged(ContextEvent contextEvent)
IContextListener
IContext
have changed. Specific details are described in
the ContextEvent
.
contextChanged
in interface IContextListener
contextEvent
- the context event. Guaranteed not to be null
.public final Set getActiveContextIds()
null
if no active contexts have been set yet. If
the set is not null
, then it contains only
instances of String
.public final Context getContext(String contextId)
contextId
- The identifier to find; must not be null
.
null
, but it might be undefined.Context
public final Set getDefinedContextIds()
null
.public final void removeActiveContext(String contextId)
contextId
- The identifier of the context to deactivate; must not be
null
.public final void removeContextManagerListener(IContextManagerListener listener)
listener
- The listener to be removed; must not be null
.public final void setActiveContextIds(Set activeContextIds)
activeContextIds
- The new set of active context identifiers; may be
null
.
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.