Package org.eclipse.ui.navigator
Interface INavigatorActivationService
-
public interface INavigatorActivationService
Determines if an extension is active within the context of a given viewer and manages the persistence of this information. 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. SeeINavigatorContentService
for more detail on what states are associated with a content extension.- Since:
- 3.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description INavigatorContentDescriptor[]
activateExtensions(String[] extensionIds, boolean toDeactivateAllOthers)
Activate the extensions specified by the extensionIds array.void
addExtensionActivationListener(IExtensionActivationListener aListener)
Request notification when the activation state changes.INavigatorContentDescriptor[]
deactivateExtensions(String[] extensionIds, boolean toActivateAllOthers)
Deactivate the extensions specified by the extensionIds.boolean
isNavigatorExtensionActive(String aNavigatorExtensionId)
Checks the known activation state for the given viewer id to determine if the given navigator extension is 'active'.void
persistExtensionActivations()
Save the activation state of each content extension for the associated content service.void
removeExtensionActivationListener(IExtensionActivationListener aListener)
No longer receive notification when activation state changes.
-
-
-
Method Detail
-
activateExtensions
INavigatorContentDescriptor[] activateExtensions(String[] extensionIds, boolean toDeactivateAllOthers)
Activate the extensions specified by the extensionIds array. Clients may also choose to disable all other extensions. The set of descriptors returned is the set that were activated as a result of this call. In the case of this method, that means that a descriptor will be returned for each extensionId in the array, regardless of whether that extension is already enabled.Clients must call
persistExtensionActivations()
to save the the activation state after activating or deactivating extensions.- Parameters:
extensionIds
- The list of extensions to activatetoDeactivateAllOthers
- True will deactivate all other extensions; False will leave the other activations as-is- Returns:
- A list of all INavigatorContentDescriptors that were activated as a result of this call. This will be the set of INavigatorContentDescriptors that corresponds exactly to the set of given extensionIds.
-
deactivateExtensions
INavigatorContentDescriptor[] deactivateExtensions(String[] extensionIds, boolean toActivateAllOthers)
Deactivate the extensions specified by the extensionIds. Clients may choose to activate all other extensions which are not explicitly disabled. If toActivateAllOthers is true, the array of returned descriptors will be the collection of all extensions not specified in the extensionIds array. If it is false, the array will be empty.Clients must call
persistExtensionActivations()
to save the the activation state after activating or deactivating extensions.- Parameters:
extensionIds
- The list of extensions to activatetoActivateAllOthers
- True will activate all other extensions; False will leave the other activations as-is- Returns:
- A list of all INavigatorContentDescriptors that were activated as a result of this call. If toActivateAllOthers is false, the result will be an empty array. Otherwise, it will be the set of all visible extensions minus those given in the 'extensionIds' parameter.
-
isNavigatorExtensionActive
boolean isNavigatorExtensionActive(String aNavigatorExtensionId)
Checks the known activation state for the given viewer id to determine if the given navigator extension is 'active'.- Parameters:
aNavigatorExtensionId
- The unique identifier associated with a given extension.- Returns:
- True if the extension is active in the context of the viewer id.
-
persistExtensionActivations
void persistExtensionActivations()
Save the activation state of each content extension for the associated content service. Clients should persist the activation state after any call toactivateExtensions(String[], boolean)
ordeactivateExtensions(String[], boolean)
.
-
addExtensionActivationListener
void addExtensionActivationListener(IExtensionActivationListener aListener)
Request notification when the activation state changes.- Parameters:
aListener
- An implementation ofIExtensionActivationListener
-
removeExtensionActivationListener
void removeExtensionActivationListener(IExtensionActivationListener aListener)
No longer receive notification when activation state changes.- Parameters:
aListener
- An implementation ofIExtensionActivationListener
-
-