KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > core > synchronize > ISyncInfoSetChangeListener


1 /*******************************************************************************
2  * Copyright (c) 2000, 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 package org.eclipse.team.core.synchronize;
12
13 import org.eclipse.core.runtime.IProgressMonitor;
14 import org.eclipse.team.core.ITeamStatus;
15
16 /**
17  * Classes which implement this interface provide methods that deal with the
18  * change events that are generated by a {@link SyncInfoSet}.
19  * <p>
20  * Implementors of this interface it can
21  * be added to a sync info set using the <code>addSyncSetChangedListener</code>
22  * method and removed using the <code>removeSyncSetChangedListener</code>
23  * method.
24  * </p><p>
25  * The originating sync set holds modification locks on the sync info set to ensure
26  * that no more changes occur until after the current change event is processed.
27  * The implementors of this interface must not modify the set within the scope of
28  * the listener's methods. If modifications are attempted a runtime exception will occur.
29  * </p>
30  * @see ISyncInfoSetChangeEvent
31  * @since 3.0
32  */

33 public interface ISyncInfoSetChangeListener {
34     
35     /**
36      * Sent when the contents of a {@link SyncInfoSet} have been reset or the
37      * listener has been connected to the set for the first time using
38      * <code>SyncInfoSet#connect(ISyncInfoSetChangeListener, IProgressMonitor)</code>. Listeners
39      * should discard any state they have accumulated from the originating sync info set
40      * and re-obtain their state from the set. The originating sync set will be
41      * locked for modification when this method is called.
42      * <p>
43      * Clients should not modify the set within this method and other threads that try to
44      * modify the set will be blocked until the reset is processed.
45      * </p>
46      * @param set the originating {@link SyncInfoSet}
47      */

48     public void syncInfoSetReset(SyncInfoSet set, IProgressMonitor monitor);
49
50     /**
51      * Sent when a {@link SyncInfoSet} changes. For example, when a resource's
52      * synchronization state changes. The originating sync set will be
53      * locked for modification when this method is called.
54      * Clients should not modify the set within this method and other threads that try to
55      * modify the set will be blocked until the change is processed.
56      * <p>
57      * If the originating set is an instance of <code>SyncInfoTree</code> then
58      * the event will be an instance of <code>ISyncInfoTreeChangeEvent</code>.
59      * Clients can determine this using an <code>instancof</code> check.
60      * </p>
61      * @param event an event containing information about the change.
62      */

63     public void syncInfoChanged(ISyncInfoSetChangeEvent event, IProgressMonitor monitor);
64     
65     /**
66      * This method is called when errors have occurred calculating the <code>SyncInfo</code>
67      * for a resource. The resource associated with the error is available from the
68      * <code>ITeamStatus</code>. This event only provides the latest errors that occurred.
69      * An array of all errors can be retrieved directly from the set.
70      *
71      * @param set the originating {@link SyncInfoSet}
72      * @param errors the errors that occurred during the latest set modifications
73      * @param monitor a progress monitor
74      */

75     public void syncInfoSetErrors(SyncInfoSet set, ITeamStatus[] errors, IProgressMonitor monitor);
76     
77 }
78
Popular Tags