KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > ui > synchronize > ISynchronizeManager


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.synchronize;
12
13 /**
14  * Manages synchronization view participants. Clients can programmatically add
15  * or remove participant instances from this manager. Managed participants are available to
16  * clients whereas un-managed participants can still exist but won't be available
17  * generally available to clients until explicitly added to the manager.
18  * <p>
19  * Participants added to the manager will benefit from the manager's lifecycle
20  * support. The participants will automatically have their <code>init</code> method and <code>dispose</code>
21  * called when the manager starts and is shutdown and if persistable will
22  * be allowed to save their state on shutdown.
23  * </p><p>
24  * Clients are not intended to implement this interface.
25  * </p>
26  * @see ISynchronizeParticipant
27  * @see org.eclipse.team.ui.TeamUI#getSynchronizeManager()
28  * @since 3.0
29  */

30 public interface ISynchronizeManager {
31     
32     /**
33      * Constant identifying the job family identifier for a background job that affects the
34      * synchronization state of resources. All clients
35      * that schedule background jobs that affect synchronization state should include this job
36      * family in their implementation of <code>belongsTo</code>.
37      *
38      * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
39      */

40     public static final Object JavaDoc FAMILY_SYNCHRONIZE_OPERATION = new Object JavaDoc();
41     
42     /**
43      * Registers the given listener for participant notifications. Has
44      * no effect if an identical listener is already registered.
45      *
46      * @param listener listener to register
47      */

48     public void addSynchronizeParticipantListener(ISynchronizeParticipantListener listener);
49     
50     /**
51      * Removes the given listener for participant notifications. Has
52      * no effect if an identical listener is not already registered.
53      *
54      * @param listener listener to remove
55      */

56     public void removeSynchronizeParticipantListener(ISynchronizeParticipantListener listener);
57
58     /**
59      * Adds the given participants to the synchronize manager. Has no effect for
60      * equivalent participants are already registered. The participants will be added
61      * to any existing synchronize views.
62      *
63      * @param participants participants to add
64      */

65     public void addSynchronizeParticipants(ISynchronizeParticipant[] participants);
66     
67     /**
68      * Removes the given participants from the synchronize manager. If the participants are
69      * being displayed in any synchronize views, their associated pages will be closed.
70      *
71      * @param participants participants to remove
72      */

73     public void removeSynchronizeParticipants(ISynchronizeParticipant[] participants);
74     
75     /**
76      * Returns a collection of synchronize participant references registered with the synchronize manager.
77      *
78      * @return a collection of synchronize participants registered with the synchronize manager.
79      */

80     public ISynchronizeParticipantReference[] getSynchronizeParticipants();
81     
82     /**
83      * Returns the registered synchronize participants with the given type id. It is
84      * possible to have multiple instances of the same participant type.
85      *
86      * @param id the type identifier for the participant
87      * @return the registered synchronize participants with the given id, or
88      * an empty list if there are none with that id registered.
89      */

90     public ISynchronizeParticipantReference[] get(String JavaDoc id);
91     
92     /**
93      * Returns the registered synchronize participants with the given type id and instance id.
94      *
95      * @param id the type identifier for the participant
96      * @param secondaryId the instance identifier for this participant type or <code>null</code>
97      * if this participant doesn't support multiple instances.
98      * @return the registered synchronize participants with the given id, or
99      * <code>null</code> if none with that id is not registered.
100      */

101     public ISynchronizeParticipantReference get(String JavaDoc id, String JavaDoc secondaryId);
102     
103     /**
104      * Opens the synchronize view in the perspective defined by the user in the team synchronize
105      * preferences.
106      *
107      * @return the opened synchronize view or <code>null</code> if it can't be opened.
108      */

109     public ISynchronizeView showSynchronizeViewInActivePage();
110
111     /**
112      * Returns the participant descriptor for the given participant type id or
113      * <code>null</code> if a descriptor is not found for that id.
114      * @param id the participant id
115      *
116      * @return the participant descriptor for the given participant id or
117      * <code>null</code> if a descriptor is not found for that id.
118      */

119     public ISynchronizeParticipantDescriptor getParticipantDescriptor(String JavaDoc id);
120 }
121
Popular Tags