KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > ui > mapping > ITeamContentProviderManager


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 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 package org.eclipse.team.ui.mapping;
12
13 import org.eclipse.core.resources.mapping.ModelProvider;
14 import org.eclipse.jface.util.IPropertyChangeListener;
15 import org.eclipse.team.core.mapping.ISynchronizationScope;
16 import org.eclipse.team.internal.ui.TeamUIPlugin;
17 import org.eclipse.team.ui.TeamUI;
18 import org.eclipse.team.ui.synchronize.ISynchronizePage;
19 import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
20
21 /**
22  * The team content provider manager provides access to the content
23  * extenstions registered with the <code>org.eclipse.team.ui.teamContentProviders</code>
24  * extension point. A team content provider defines a mapping between
25  * a {@link ModelProvider} and a content extension registered with
26  * the <code>org.eclipse.ui.navigator.navigatorContent</code> extension point.
27  * <p>
28  * This interface is not intended to be implemented by clients.
29  *
30  * @see TeamUI#getTeamContentProviderManager()
31  * @see ModelProvider
32  * @since 3.2
33  */

34 public interface ITeamContentProviderManager {
35
36     /**
37      * Property constant used to store and retrieve the synchronization page
38      * configuration from the
39      * {@link org.eclipse.ui.navigator.IExtensionStateModel} used by the Common
40      * Navigator framework.
41      */

42     public static final String JavaDoc P_SYNCHRONIZATION_PAGE_CONFIGURATION = TeamUIPlugin.ID + ".synchronizationPageConfiguration"; //$NON-NLS-1$
43
/**
44      * Property constant used to store and retrieve the synchronization context
45      * from the {@link org.eclipse.ui.navigator.IExtensionStateModel} used by
46      * the Common Navigator framework. It is also used to associate a context
47      * with an {@link ISynchronizePageConfiguration} when models are being
48      * shown in an {@link ISynchronizePage}.
49      */

50     public static final String JavaDoc P_SYNCHRONIZATION_CONTEXT = TeamUIPlugin.ID + ".synchronizationContext"; //$NON-NLS-1$
51

52     /**
53      * Property constant used to store and retrieve the resource mapping scope
54      * from the {@link org.eclipse.ui.navigator.IExtensionStateModel} used by
55      * the Common Navigator framework. It is also used to associate a scope
56      * with an {@link ISynchronizePageConfiguration} when models are being
57      * shown in an {@link ISynchronizePage}.
58      */

59     public static final String JavaDoc P_SYNCHRONIZATION_SCOPE = TeamUIPlugin.ID + ".synchronizationScope"; //$NON-NLS-1$
60

61     /**
62      * Property constant used to store and retrieve the page layout
63      * from the {@link ISynchronizePageConfiguration} when models are being
64      * shown in an {@link ISynchronizePage}. At this time, there are two layouts,
65      * TREE_LAYOUT and FLAT_LAYOUT. Other may be added
66      * @since 3.3
67      */

68     public static final String JavaDoc PROP_PAGE_LAYOUT = TeamUIPlugin.ID + ".pageLayout"; //$NON-NLS-1$
69

70     /**
71      * Value for the PROP_PAGE_LAYOUT that indicates that the models should display
72      * their elements in tree form.
73      * @since 3.3
74      */

75     public static final String JavaDoc TREE_LAYOUT = TeamUIPlugin.ID + ".treeLayout"; //$NON-NLS-1$
76

77     /**
78      * Value for the PROP_PAGE_LAYOUT that indicates that the models should display
79      * their elements as a flat list. Only models that indicate in their <code>teamContentProviders</code>
80      * that they support the flat layout will be enabled when the PROP_PAGE_LAYOUT is set
81      * to FLAT_LAYOUT.
82      * @since 3.3
83      */

84     public static final String JavaDoc FLAT_LAYOUT = TeamUIPlugin.ID + ".flatLayout"; //$NON-NLS-1$
85

86     /**
87      * Property constant used during property change notification to indicate
88      * that one one or more model providers have either been enabled or disabled.
89      */

90     public static final String JavaDoc PROP_ENABLED_MODEL_PROVIDERS = TeamUIPlugin.ID + ".ENABLED_MODEL_PROVIDERS"; //$NON-NLS-1$
91

92     /**
93      * Return descriptors for all the registered content extensions.
94      * @return descriptors for all the registered content extensions
95      */

96     public ITeamContentProviderDescriptor[] getDescriptors();
97
98     /**
99      * Return the team content provider descriptor for the
100      * given model provider id. A <code>null</code> is
101      * returned if no extension is registered.
102      * @param modelProviderId the model provider id
103      * @return the team content provider descriptor for the
104      * given model provider id or <code>null</code>
105      */

106     public ITeamContentProviderDescriptor getDescriptor(
107             String JavaDoc modelProviderId);
108     
109     /**
110      * Add a property change listener to the manager.
111      * @param listener the listener
112      */

113     public void addPropertyChangeListener(IPropertyChangeListener listener);
114     
115     /**
116      * Remove a property change listener from the manager.
117      * @param listener the listener
118      */

119     public void removePropertyChangeListener(IPropertyChangeListener listener);
120
121     /**
122      * Convenience method that returns the list of all enabled content extension ids for
123      * models that have mappings in the given scope.
124      *
125      * @param scope
126      * the scope
127      * @return the list of all content extension ids for models that have
128      * mappings in the given scope
129      */

130     public String JavaDoc[] getContentProviderIds(ISynchronizationScope scope);
131     
132     /**
133      * Enable the given content descriptors, disabling all others.
134      * This method will fire a {@link ITeamContentProviderManager#PROP_ENABLED_MODEL_PROVIDERS}
135      * property change event to any registered listeners.
136      * @param descriptors the descriptors to be enabled.
137      * @see ITeamContentProviderDescriptor#isEnabled()
138      * @since 3.3
139      */

140     public void setEnabledDescriptors(ITeamContentProviderDescriptor[] descriptors);
141
142 }
143
Popular Tags