KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > progress > IWorkbenchSiteProgressService


1 /*******************************************************************************
2  * Copyright (c) 2003, 2007 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 - Initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.progress;
12
13 import org.eclipse.core.runtime.jobs.Job;
14 import org.eclipse.ui.IWorkbenchPartSite;
15 import org.eclipse.ui.presentations.IPresentablePart;
16
17 /**
18  * IWorkbenchPartProgressService is an IProgressService that adds API for
19  * jobs that change the state in a IWorkbenchPartSite while they are being
20  * run.
21  *
22  * WorkbenchParts may access an instance of IWorkbenchSiteProgressService
23  * by calling
24  * <code>getSite.getAdapter(IWorkbenchSiteProgressService.class);</code>
25  *
26  * This interface is not intended to be implemented by client
27  * plug-ins.
28  * @see IWorkbenchPartSite#getAdapter(Class)
29  * @since 3.0
30  */

31 public interface IWorkbenchSiteProgressService extends IProgressService {
32
33     /**
34      * The property that is sent with busy notifications.
35      */

36     public static final String JavaDoc BUSY_PROPERTY = "SITE_BUSY"; //$NON-NLS-1$
37

38     /**
39      * Jobs scheduled with this method will cause the part's presentation
40      * to be changed to indicate that the part is busy and in a transient
41      * state until the job completes. Parts can also add customized busy
42      * indication by overriding <code>WorkbenchPart.setBusy()</code>.
43      * If useHalfBusyCursor is true then the cursor will change to
44      * the half busy cursor for the duration of the job.
45      * @param job The job to schedule
46      * @param delay The delay in scheduling.
47      * @param useHalfBusyCursor A boolean to indicate if the half busy
48      * cursor should be used while this job is running.
49      * @see Job#schedule(long)
50      */

51     public void schedule(Job job, long delay, boolean useHalfBusyCursor);
52
53     /**
54      * Jobs scheduled with this method will cause the part's presentation
55      * to be changed to indicate that the part is busy and in a transient
56      * state until the job completes. Parts can also add customized busy
57      * indication by overriding <code>WorkbenchPart.setBusy</code>.
58      * @param job The job to schedule
59      * @param delay The delay in scheduling.
60      * @see Job#schedule(long)
61      */

62     public void schedule(Job job, long delay);
63
64     /**
65      * Jobs scheduled with this method will cause the part's presentation
66      * to be changed to indicate that the part is busy and in a transient
67      * state until the job completes. Parts can also add customized busy
68      * indication by overriding <code>WorkbenchPart.setBusy</code>.
69      * @param job The job to schedule
70      * @see Job#schedule()
71      */

72     public void schedule(Job job);
73
74     /**
75      * Show busy state if any job of the specified family is running.
76      * @param family Object
77      * @see Job#belongsTo(Object)
78      */

79     public void showBusyForFamily(Object JavaDoc family);
80
81     /**
82      * Warn that the content of the receiver has
83      * changed. The method of this is determined by
84      * how the presentation shows this.
85      * @see IPresentablePart#PROP_HIGHLIGHT_IF_BACK
86      */

87     public void warnOfContentChange();
88     
89     /**
90      * Increments the busy counter for this workbench site. This API should only
91      * be used for background work that does not use jobs. As long as there have
92      * been more calls to incrementBusy() than to decrementBusy(), the part will
93      * show a busy affordance. Each call to incrementBusy must be followed by a
94      * call to decrementBusy once the caller no longer needs the part to show
95      * the busy affordance.
96      * <p>
97      * Note that the job-related methods on this class are another way to let
98      * the part show a busy affordance. A part will only appear non-busy if no
99      * jobs have been scheduled through this service, and the internal busy
100      * counter is not positive.
101      * </p>
102      *
103      * @since 3.3
104      */

105     public void incrementBusy();
106
107     /**
108      * Decrements the busy counter for this workbench site. This API should only
109      * be used for background work that does not use jobs. It is an error to call
110      * this method without first making a matching call to {@link #incrementBusy()}.
111      *
112      * @since 3.3
113      */

114     public void decrementBusy();
115     
116 }
117
Popular Tags