KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > navigator > INavigatorActivationService


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  ******************************************************************************/

11
12 package org.eclipse.ui.navigator;
13
14 /**
15  *
16  * Determines if an extension is <i>active</i> within the context of a given
17  * viewer and manages the persistence of this information. If an extension is
18  * <i>active</i> then the extension will contribute functionality to the
19  * viewer. If an extension is not <i>active</i>, then the extension will not be
20  * given opportunities to contribute functionality to the given viewer. See
21  * {@link INavigatorContentService} for more detail on what states are
22  * associated with a content extension.
23  *
24  * @since 3.2
25  *
26  */

27 public interface INavigatorActivationService {
28
29     /**
30      * Activate the extensions specified by the extensionIds array. Clients may
31      * also choose to disable all other extensions. The set of descriptors
32      * returned is the set that were activated as a result of this call. In the
33      * case of this method, that means that a descriptor will be returned for
34      * each extensionId in the array, regardless of whether that extension is
35      * already enabled.
36      *
37      * <p>
38      * Clients must call {@link #persistExtensionActivations()} to save the the
39      * activation state after activating or deactivating extensions.
40      * </p>
41      *
42      * @param extensionIds
43      * The list of extensions to activate
44      * @param toDeactivateAllOthers
45      * True will deactivate all other extensions; False will leave
46      * the other activations as-is
47      * @return A list of all INavigatorContentDescriptors that were activated as
48      * a result of this call. This will be the set of
49      * INavigatorContentDescriptors that corresponds exactly to the set
50      * of given extensionIds.
51      */

52     public INavigatorContentDescriptor[] activateExtensions(
53             String JavaDoc[] extensionIds, boolean toDeactivateAllOthers);
54
55     /**
56      * Deactivate the extensions specified by the extensionIds. Clients may
57      * choose to activate all other extensions which are not explicitly
58      * disabled. If toActivateAllOthers is true, the array of returned
59      * descriptors will be the collection of all extensions not specified in the
60      * extensionIds array. If it is false, the array will be empty.
61      *
62      * <p>
63      * Clients must call {@link #persistExtensionActivations()} to save the the
64      * activation state after activating or deactivating extensions.
65      * </p>
66      *
67      * @param extensionIds
68      * The list of extensions to activate
69      * @param toActivateAllOthers
70      * True will activate all other extensions; False will leave the
71      * other activations as-is
72      * @return A list of all INavigatorContentDescriptors that were activated as
73      * a result of this call. If toActivateAllOthers is false, the
74      * result will be an empty array. Otherwise, it will be the set of
75      * all visible extensions minus those given in the 'extensionIds'
76      * parameter.
77      */

78     public INavigatorContentDescriptor[] deactivateExtensions(
79             String JavaDoc[] extensionIds, boolean toActivateAllOthers);
80
81     /**
82      *
83      * Checks the known activation state for the given viewer id to determine if
84      * the given navigator extension is 'active'.
85      *
86      * @param aNavigatorExtensionId
87      * The unique identifier associated with a given extension.
88      *
89      * @return True if the extension is active in the context of the viewer id.
90      */

91     public boolean isNavigatorExtensionActive(String JavaDoc aNavigatorExtensionId);
92
93     /**
94      * Save the activation state of each content extension for the associated
95      * content service. Clients should persist the activation state after any
96      * call to {@link #activateExtensions(String[], boolean)} or
97      * {@link #deactivateExtensions(String[], boolean)}.
98      *
99      */

100     public void persistExtensionActivations();
101
102     /**
103      * Request notification when the activation state changes.
104      *
105      * @param aListener
106      * An implementation of {@link IExtensionActivationListener}
107      */

108     public void addExtensionActivationListener(
109             IExtensionActivationListener aListener);
110
111     /**
112      * No longer receive notification when activation state changes.
113      *
114      * @param aListener
115      * An implementation of {@link IExtensionActivationListener}
116      */

117     public void removeExtensionActivationListener(
118             IExtensionActivationListener aListener);
119 }
120
Popular Tags