KickJava   Java API By Example, From Geeks To Geeks.

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


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.resources.IResource;
14
15 /**
16  * An event generated when a {@link SyncInfoSet} collection is changed. The event contains
17  * a description of the changes which include added, changed and removed resources.
18  * In some cases, (e.g. when the change is too complicated to be efficiently described
19  * using the mechanisms provided by this interface) the event will be a reset. In these
20  * cases, the client should ignore any other contents of the event and recalculate
21  * from scratch any state that is derived from the <code>SyncInfoSet</code> from
22  * which the event originated.
23  * <p>
24  * The mix of return types, <code>SyncInfo</code> and <code>IResource</code>is required as a result of an optimization
25  * included in {@link SyncInfoSet} collections that doesn't maintain <code>SyncInfo</code> objects
26  * for in-sync resources.
27  * </p>
28  * @see SyncInfoSet#addSyncSetChangedListener(ISyncInfoSetChangeListener)
29  * @see ISyncInfoSetChangeListener
30  * @since 3.0
31  */

32 public interface ISyncInfoSetChangeEvent {
33
34     /**
35      * Returns newly added out-of-sync <code>SyncInfo</code> elements.
36      *
37      * @return newly added <code>SyncInfo</code> elements or an empty list if this event
38      * doesn't contain added resources.
39      */

40     public SyncInfo[] getAddedResources();
41     
42     /**
43      * Returns changed <code>SyncInfo</code> elements. The returned elements
44      * are still out-of-sync.
45      *
46      * @return changed <code>SyncInfo</code> elements or an empty list if this event
47      * doesn't contain changes resources.
48      */

49     public SyncInfo[] getChangedResources();
50     
51     /**
52      * Returns the removed <code>IResource</code> elements for which the set no longer
53      * contains on out-of-sync <code>SyncInfo</code>. The returned elements
54      * are all in-sync resources.
55      *
56      * @return removed <code>SyncInfo</code> elements or an empty list if this event
57      * doesn't contain removed resources.
58      */

59     public IResource[] getRemovedResources();
60     
61     /**
62      * Returns the {@link SyncInfoSet} that generated these events.
63      *
64      * @return the {@link SyncInfoSet} that generated these events.
65      */

66     public SyncInfoSet getSet();
67     
68 }
69
Popular Tags