Skip to main content
summaryrefslogtreecommitdiffstats
blob: 1961991c7f9ee8af4dbab32d9704b8dbdfb5da19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.core.subscribers;
import org.eclipse.core.resources.IResource;

/**
 * A change event that describes a change in a resource
 * that is or was supervised by a subscriber.
 * <p>
 * Clients are not intented to implement. Instead subclass {@link SubscriberChangeEvent}.
 * </p>
 * @see ISubscriberChangeListener
 * @since 3.0
 */
public interface ISubscriberChangeEvent {
	/*====================================================================
	 * Constants defining the kinds of team changes to resources:
	 *====================================================================*/
	/**
	 * Delta kind constant indicating that the resource has not been changed in any way
	 * @see IResourceDelta#getKind
	 */
	public static final int NO_CHANGE = 0;
	/**
	 * Delta kind constant (bit mask) indicating that the synchronization state of a resource has changed.
	 * @see #getFlags
	 */
	public static final int SYNC_CHANGED = 0x1;
	/**
	 * Delta kind constant (bit mask) indicating that a team provider has been configured on the resource.
	 * @see  #getFlags
	 */
	public static final int ROOT_ADDED = 0x2;
	/**
	 * Delta kind constant (bit mask) indicating that a team provider has been de-configured on the resource.
	 * @see #getFlags
	 */
	public static final int ROOT_REMOVED = 0x4;
	
	/**
	 * Return the flags that describe the type of change.
	 * The returned value should be ANDed with the change type
	 * flags to determine whether the change event is of 
	 * a particular type. For exampe,
	 * <pre>
	 *   if (event.getFlags() & ISubscriberChangeEvent.SYNC_CHANGED) {
	 *      // the sync info for the resource has changed
	 *   }
	 * </pre>
	 * @return the flags that describe the type of change
	 */
	public abstract int getFlags();
	
	/**
	 * Return the resource whose state with
	 * respect to the subscriber has changed.
	 * @return the resource whose state with
	 * respect to the subscriber has changed
	 */
	public abstract IResource getResource();
	
	/**
	 * Return the subscriber to which this change event applies.
	 * @return the subscriber to which this change event applies
	 */
	public abstract Subscriber getSubscriber();
}

Back to the top