Class ContextManagerEvent
- java.lang.Object
-
- org.eclipse.core.commands.common.AbstractBitSetEvent
-
- org.eclipse.core.commands.contexts.ContextManagerEvent
-
public final class ContextManagerEvent extends AbstractBitSetEvent
An event indicating that the set of defined context identifiers has changed.
- Since:
- 3.1
- See Also:
IContextManagerListener.contextManagerChanged(ContextManagerEvent)
-
-
Field Summary
-
Fields inherited from class org.eclipse.core.commands.common.AbstractBitSetEvent
changedValues
-
-
Constructor Summary
Constructors Constructor Description ContextManagerEvent(ContextManager contextManager, String contextId, boolean contextIdAdded, boolean activeContextsChanged, Set previouslyActiveContextIds)
Creates a new instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getContextId()
Returns the context identifier that was added or removed.ContextManager
getContextManager()
Returns the instance of the interface that changed.Set
getPreviouslyActiveContextIds()
Returns the set of identifiers to previously active contexts.boolean
isActiveContextsChanged()
Returns whether the active context identifiers have changed.boolean
isContextChanged()
Returns whether the list of defined context identifiers has changed.boolean
isContextDefined()
Returns whether the context identifier became defined.
-
-
-
Constructor Detail
-
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 Detail
-
getContextId
public final String 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
public final ContextManager getContextManager()
Returns the instance of the interface that changed.- Returns:
- the instance of the interface that changed. Guaranteed not to be
null
.
-
getPreviouslyActiveContextIds
public final Set 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.
-
-