Class ContextManagerEvent
java.lang.Object
org.eclipse.core.commands.common.AbstractBitSetEvent
org.eclipse.core.commands.contexts.ContextManagerEvent
An event indicating that the set of defined context identifiers has changed.
- Since:
- 3.1
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.core.commands.common.AbstractBitSetEvent
changedValues
-
Constructor Summary
ConstructorDescriptionContextManagerEvent
(ContextManager contextManager, String contextId, boolean contextIdAdded, boolean activeContextsChanged, Set previouslyActiveContextIds) Creates a new instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
Returns the context identifier that was added or removed.final ContextManager
Returns the instance of the interface that changed.final Set
Returns the set of identifiers to previously active contexts.final boolean
Returns whether the active context identifiers have changed.final boolean
Returns whether the list of defined context identifiers has changed.final boolean
Returns whether the context identifier became defined.
-
Constructor Details
-
ContextManagerEvent
public ContextManagerEvent(ContextManager contextManager, String contextId, boolean contextIdAdded, boolean activeContextsChanged, Set previouslyActiveContextIds) Creates a new instance of this class.- Parameters:
contextManager
- the instance of the interface that changed; must not benull
.contextId
- The context identifier that was added or removed; may benull
if the active contexts are changing.contextIdAdded
- Whether the context identifier became defined (otherwise, it became undefined).activeContextsChanged
- Whether the list of active contexts has changed.previouslyActiveContextIds
- the set of identifiers of previously active contexts. This set may be empty. If this set is not empty, it must only contain instances ofString
. This set must benull
if activeContextChanged isfalse
and must not be null if activeContextChanged istrue
.
-
-
Method Details
-
getContextId
Returns the context identifier that was added or removed.- Returns:
- The context identifier that was added or removed. This value may
be
null
if no context identifier was added or removed.
-
getContextManager
Returns the instance of the interface that changed.- Returns:
- the instance of the interface that changed. Guaranteed not to be
null
.
-
getPreviouslyActiveContextIds
Returns the set of identifiers to previously active contexts.- Returns:
- the set of identifiers to previously active contexts. This set
may be empty. If this set is not empty, it is guaranteed to only
contain instances of
String
. This set is guaranteed to benull
if haveActiveContextChanged() isfalse
and is guaranteed to not benull
if haveActiveContextsChanged() istrue
.
-
isActiveContextsChanged
public final boolean isActiveContextsChanged()Returns whether the active context identifiers have changed.- Returns:
true
if the collection of active contexts changed;false
otherwise.
-
isContextChanged
public final boolean isContextChanged()Returns whether the list of defined context identifiers has changed.- Returns:
true
if the list of context identifiers has changed;false
otherwise.
-
isContextDefined
public final boolean isContextDefined()Returns whether the context identifier became defined. Otherwise, the context identifier became undefined.- Returns:
true
if the context identifier became defined;false
if the context identifier became undefined.
-