KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > core > subscribers > SyncSetInputFromSubscriber


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.internal.core.subscribers;
12
13 import org.eclipse.core.runtime.IProgressMonitor;
14 import org.eclipse.team.core.ITeamStatus;
15 import org.eclipse.team.core.TeamException;
16 import org.eclipse.team.core.subscribers.Subscriber;
17
18 /**
19  * Records resource synchronization changes from a Team subscriber. The actual changes
20  * are calculated via the SubscriberEventHandler and stored in this input.
21  */

22 public class SyncSetInputFromSubscriber extends SyncSetInput {
23
24     private Subscriber subscriber;
25
26     public SyncSetInputFromSubscriber(Subscriber subscriber, SubscriberEventHandler handler) {
27         super(handler);
28         this.subscriber = subscriber;
29     }
30         
31     public void disconnect() {
32     }
33     
34     public Subscriber getSubscriber() {
35         return subscriber;
36     }
37     
38     /* (non-Javadoc)
39      * @see org.eclipse.team.internal.ui.sync.views.SyncSetInput#fetchInput(org.eclipse.core.runtime.IProgressMonitor)
40      */

41     protected void fetchInput(IProgressMonitor monitor) throws TeamException {
42         // don't calculate changes. The SubscriberEventHandler will fetch the
43
// input in a job and update this sync set when the changes are
44
// calculated.
45
}
46
47     /**
48      * Handle an error that occurred while populating the receiver's set.
49      * The <code>ITeamStatus</code> includes the resource for which the
50      * error occurred.
51      * This error is propogated to any set listeners.
52      * @param status the error status
53      */

54     public void handleError(ITeamStatus status) {
55         getSyncSet().addError(status);
56     }
57 }
58
Popular Tags