Eclipse Platform
Release 3.2

org.eclipse.ui.navigator
Class NavigatorActivationService

java.lang.Object
  extended byorg.eclipse.ui.navigator.NavigatorActivationService

public final class NavigatorActivationService
extends Object

The activation service determines if an extension is 'active' within the context of a given viewer. If an extension is 'active' then the extension will contribute functionality to the viewer. If an extension is not 'active', then the extension will not be given opportunities to contribute functionality to the given viewer. See INavigatorContentService for more detail on what 'states' are associated with a content extension.

EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.

Since:
3.2

Method Summary
 void activateNavigatorExtension(String aViewerId, String[] aNavigatorExtensionIds, boolean toEnable)
          Set the activation state for the given extension in the context of the given viewer id.
 void activateNavigatorExtension(String aViewerId, String aNavigatorExtensionId, boolean toEnable)
          Set the activation state for the given extension in the context of the given viewer id.
 void addExtensionActivationListener(String aViewerId, IExtensionActivationListener aListener)
          Request notification when the activation state changes for the given viewer id.
static NavigatorActivationService getInstance()
          Returns the singleton instance of the known activations.
 boolean isNavigatorExtensionActive(String aViewerId, String aNavigatorExtensionId)
          Checks the known activation state for the given viewer id to determine if the given navigator extension is 'active'.
 void persistExtensionActivations(String aViewerId)
          Save the activation state for the given viewer.
 void removeExtensionActivationListener(String aViewerId, IExtensionActivationListener aListener)
          No longer receive notification when activation state changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static NavigatorActivationService getInstance()
Returns the singleton instance of the known activations.

Returns:
The single instance of the activation service.

isNavigatorExtensionActive

public boolean isNavigatorExtensionActive(String aViewerId,
                                          String aNavigatorExtensionId)
Checks the known activation state for the given viewer id to determine if the given navigator extension is 'active'.

Parameters:
aViewerId - The unique identifier for a defined viewer that uses an INavigatorContentService for its content.
aNavigatorExtensionId - The unique identifier associated with a given extension.
Returns:
True if the extension is active in the context of the viewer id.

activateNavigatorExtension

public void activateNavigatorExtension(String aViewerId,
                                       String aNavigatorExtensionId,
                                       boolean toEnable)
Set the activation state for the given extension in the context of the given viewer id. Each instance of an INavigatorContentService listens for the activation service to update; and if those instances were created with viewers, they will issue a refresh. Otherwise, clients are responsible for refreshing the viewers.

Clients must call persistExtensionActivations(String) to save the the activation state.

When clients are updating a batch of extensions, consider using activateNavigatorExtension(String, String[], boolean) when possible to avoid unnecessary notifications.

Parameters:
aViewerId - The unique identifier for a defined viewer that uses an INavigatorContentService for its content.
aNavigatorExtensionId - The unique identifier associated with a given extension.
toEnable - True indicates the extension should be enabled; False indicates otherwise.

activateNavigatorExtension

public void activateNavigatorExtension(String aViewerId,
                                       String[] aNavigatorExtensionIds,
                                       boolean toEnable)
Set the activation state for the given extension in the context of the given viewer id. Each instance of an INavigatorContentService listens for the activation service to update; and if those instances were created with viewers, they will issue a refresh. Otherwise, clients are responsible for refreshing the viewers.

Clients must call persistExtensionActivations(String) to save the the activation state.

Parameters:
aViewerId - The unique identifier for a defined viewer that uses an INavigatorContentService for its content.
aNavigatorExtensionIds - An array of unique identifiers associated with existing extension.
toEnable - True indicates the extension should be enabled; False indicates otherwise.

persistExtensionActivations

public void persistExtensionActivations(String aViewerId)
Save the activation state for the given viewer.

Parameters:
aViewerId - The unique identifier for a defined viewer that uses an INavigatorContentService for its content.

addExtensionActivationListener

public void addExtensionActivationListener(String aViewerId,
                                           IExtensionActivationListener aListener)
Request notification when the activation state changes for the given viewer id.

Parameters:
aViewerId - The unique identifier for a defined viewer that uses an INavigatorContentService for its content.
aListener - An implementation of IExtensionActivationListener

removeExtensionActivationListener

public void removeExtensionActivationListener(String aViewerId,
                                              IExtensionActivationListener aListener)
No longer receive notification when activation state changes.

Parameters:
aViewerId - The unique identifier for a defined viewer that uses an INavigatorContentService for its content.
aListener - An implementation of IExtensionActivationListener

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.