Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.core.commands.contexts
Class ContextManager


java.lang.Object
  extended by 

org.eclipse.core.commands.common.EventManager
      extended by 

org.eclipse.core.commands.common.HandleObjectManager
          extended by 
org.eclipse.core.commands.contexts.ContextManager
All Implemented Interfaces:
IContextListener

public final class ContextManager
extends HandleObjectManager
implements IContextListener

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.

Since:
3.1

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.
 
Fields inherited from class org.eclipse.core.commands.common. HandleObjectManager
definedHandleObjects, handleObjectsById
 
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.
 void deferUpdates (boolean defer)
          Informs the manager that a batch operation has started.
  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.
  Context[] getDefinedContexts ()
          Returns the 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 org.eclipse.core.commands.common. HandleObjectManager
checkId, getDefinedHandleObjectIds
 
Methods inherited from class org.eclipse.core.commands.common. EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public 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 Detail

ContextManager

public ContextManager()
Method Detail

deferUpdates

public void deferUpdates(boolean defer)
Informs the manager that a batch operation has started.

Note: You must insure that if you call deferUpdates(true) that nothing in your batched operation will prevent the matching call to deferUpdates(false).

Parameters:
defer - true when starting a batch operation false when ending the operation
Since:
3.5

addActiveContext

public final void addActiveContext(
String contextId)
Activates a context in this context manager.

Parameters:
contextId - The identifier of the context to activate; must not be null.

addContextManagerListener

public final void addContextManagerListener(
IContextManagerListener listener)
Adds a listener to this context manager. The listener will be notified when the set of defined contexts changes. This can be used to track the global appearance and disappearance of contexts.

Parameters:
listener - The listener to attach; must not be null.

contextChanged

public final void contextChanged(
ContextEvent contextEvent)
Description copied from interface: IContextListener
Notifies that one or more properties of an instance of IContext have changed. Specific details are described in the ContextEvent.

Specified by:
contextChanged in interface IContextListener
Parameters:
contextEvent - the context event. Guaranteed not to be null.

getActiveContextIds

public final 
Set getActiveContextIds()
Returns the set of active context identifiers.

Returns:
The set of active context identifiers; this value may be null if no active contexts have been set yet. If the set is not null, then it contains only instances of String.

getContext

public final 
Context getContext(
String contextId)
Gets the context with the given identifier. If no such context currently exists, then the context will be created (but be undefined).

Parameters:
contextId - The identifier to find; must not be null.
Returns:
The context with the given identifier; this value will never be null, but it might be undefined.
See Also:
Context

getDefinedContextIds

public final 
Set getDefinedContextIds()
Returns the set of identifiers for those contexts that are defined.

Returns:
The set of defined context identifiers; this value may be empty, but it is never null.

getDefinedContexts

public final 
Context[] getDefinedContexts()
Returns the those contexts that are defined.

Returns:
The defined contexts; this value may be empty, but it is never null.
Since:
3.2

removeActiveContext

public final void removeActiveContext(
String contextId)
Deactivates a context in this context manager.

Parameters:
contextId - The identifier of the context to deactivate; must not be null.

removeContextManagerListener

public final void removeContextManagerListener(
IContextManagerListener listener)
Removes a listener from this context manager.

Parameters:
listener - The listener to be removed; must not be null.

setActiveContextIds

public final void setActiveContextIds(
Set activeContextIds)
Changes the set of active contexts for this context manager. The whole set is required so that internal consistency can be maintained and so that excessive recomputations do nothing occur.

Parameters:
activeContextIds - The new set of active context identifiers; may be null.

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire