KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ui > synchronize > IRefreshEvent


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.ui.synchronize;
12
13 import org.eclipse.core.resources.IResource;
14 import org.eclipse.core.runtime.IProgressMonitor;
15 import org.eclipse.core.runtime.IStatus;
16 import org.eclipse.team.core.subscribers.Subscriber;
17 import org.eclipse.team.internal.ui.synchronize.RefreshParticipantJob.IChangeDescription;
18 import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
19
20 /**
21  * An event describing the lifecycle of a {@link Subscriber#refresh(IResource[], int, IProgressMonitor)} operation.
22  * <p>
23  * This interface is not intended to be implemented by clients.
24  * </p>
25  * @see Subscriber
26  * @see IRefreshSubscriberListener
27  * @since 3.0
28  */

29 public interface IRefreshEvent {
30     /**
31      * Status code indicating that the refresh has changes to the selected
32      * resources that were refreshed.
33      */

34     public static final int STATUS_CHANGES = 1;
35     
36     /**
37      * Status code indicating that the refresh has changes to the selected
38      * resources that were refreshed.
39      */

40     public static final int STATUS_NEW_CHANGES = 2;
41     
42     /**
43      * Status code indicating that the refresh didn't find changes on the selected
44      * resources that were refreshed.
45      */

46     public static final int STATUS_NO_CHANGES = 0;
47     
48     /**
49      * Constant which identifies this event as generated by a scheduled refresh.
50      * @see #getRefreshType()
51      */

52     public static final int SCHEDULED_REFRESH = 1;
53     
54     /**
55      * Constant which identifies the event as a refresh initiated by a user.
56      * @see #getRefreshType()
57      */

58     public static final int USER_REFRESH = 2;
59     
60     /**
61      * Returns the type of this event. The returned value will be one of <code>SCHEDULED_REFRESH</code>,
62      * <code>USER_REFRESH</code>.
63      *
64      * @return the type of this event
65      * @see #SCHEDULED_REFRESH
66      * @see #USER_REFRESH
67      */

68     public int getRefreshType();
69     
70     /**
71      * The participant that was refreshed.
72      *
73      * @return the participant that was refreshed.
74      */

75     public ISynchronizeParticipant getParticipant();
76     
77     /**
78      * Return a description of the changes found.
79      *
80      * @return a description of the changes found
81      */

82     public IChangeDescription getChangeDescription();
83     
84     /**
85      * The time, in milliseconds, at which the refresh was started.
86      *
87      * @return the time, in milliseconds, at which the refresh was started.
88      */

89     public long getStartTime();
90     
91     /**
92      * The time, in milliseconds, at which the refresh was completed.
93      *
94      * @return the time, in milliseconds, at which the refresh was completed.
95      */

96     public long getStopTime();
97     
98     /**
99      * Returns the status of the refresh operation. This can be used to determine if the
100      * refresh completed successfully, with an error, or was canceled.
101      *
102      * @return the status of the refresh operation.
103      */

104     public IStatus getStatus();
105
106     /**
107      * Set whether this event is being presented in a progress view link
108      * @param isLink
109      */

110     public void setIsLink(boolean isLink);
111     
112     /**
113      * Return whether this event is being displayed in a link.
114      * @return whether this event is being displayed in a link
115      */

116     public boolean isLink();
117 }
118
Popular Tags