001: /*******************************************************************************
002: * Copyright (c) 2003, 2007 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM - Initial API and implementation
010: *******************************************************************************/package org.eclipse.ui.progress;
011:
012: import org.eclipse.core.runtime.jobs.Job;
013: import org.eclipse.ui.IWorkbenchPartSite;
014: import org.eclipse.ui.presentations.IPresentablePart;
015:
016: /**
017: * IWorkbenchPartProgressService is an IProgressService that adds API for
018: * jobs that change the state in a IWorkbenchPartSite while they are being
019: * run.
020: *
021: * WorkbenchParts may access an instance of IWorkbenchSiteProgressService
022: * by calling
023: * <code>getSite.getAdapter(IWorkbenchSiteProgressService.class);</code>
024: *
025: * This interface is not intended to be implemented by client
026: * plug-ins.
027: * @see IWorkbenchPartSite#getAdapter(Class)
028: * @since 3.0
029: */
030: public interface IWorkbenchSiteProgressService extends IProgressService {
031:
032: /**
033: * The property that is sent with busy notifications.
034: * @deprecated this property is no longer in use in the Eclipse SDK
035: */
036: public static final String BUSY_PROPERTY = "SITE_BUSY"; //$NON-NLS-1$
037:
038: /**
039: * Jobs scheduled with this method will cause the part's presentation
040: * to be changed to indicate that the part is busy and in a transient
041: * state until the job completes. Parts can also add customized busy
042: * indication by overriding <code>WorkbenchPart.setBusy()</code>.
043: * If useHalfBusyCursor is true then the cursor will change to
044: * the half busy cursor for the duration of the job.
045: * @param job The job to schedule
046: * @param delay The delay in scheduling.
047: * @param useHalfBusyCursor A boolean to indicate if the half busy
048: * cursor should be used while this job is running.
049: * @see Job#schedule(long)
050: */
051: public void schedule(Job job, long delay, boolean useHalfBusyCursor);
052:
053: /**
054: * Jobs scheduled with this method will cause the part's presentation
055: * to be changed to indicate that the part is busy and in a transient
056: * state until the job completes. Parts can also add customized busy
057: * indication by overriding <code>WorkbenchPart.setBusy</code>.
058: * @param job The job to schedule
059: * @param delay The delay in scheduling.
060: * @see Job#schedule(long)
061: */
062: public void schedule(Job job, long delay);
063:
064: /**
065: * Jobs scheduled with this method will cause the part's presentation
066: * to be changed to indicate that the part is busy and in a transient
067: * state until the job completes. Parts can also add customized busy
068: * indication by overriding <code>WorkbenchPart.setBusy</code>.
069: * @param job The job to schedule
070: * @see Job#schedule()
071: */
072: public void schedule(Job job);
073:
074: /**
075: * Show busy state if any job of the specified family is running.
076: * @param family Object
077: * @see Job#belongsTo(Object)
078: */
079: public void showBusyForFamily(Object family);
080:
081: /**
082: * Warn that the content of the receiver has
083: * changed. The method of this is determined by
084: * how the presentation shows this.
085: * @see IPresentablePart#PROP_HIGHLIGHT_IF_BACK
086: */
087: public void warnOfContentChange();
088:
089: /**
090: * Increments the busy counter for this workbench site. This API should only
091: * be used for background work that does not use jobs. As long as there have
092: * been more calls to incrementBusy() than to decrementBusy(), the part will
093: * show a busy affordance. Each call to incrementBusy must be followed by a
094: * call to decrementBusy once the caller no longer needs the part to show
095: * the busy affordance.
096: * <p>
097: * Note that the job-related methods on this class are another way to let
098: * the part show a busy affordance. A part will only appear non-busy if no
099: * 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: }
|