01: /*******************************************************************************
02: * Copyright (c) 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: ******************************************************************************/package org.eclipse.ui.progress;
11:
12: import org.eclipse.core.runtime.IProgressMonitor;
13: import org.eclipse.core.runtime.IStatus;
14:
15: /**
16: * Interface for runnables that can be run as jobs.
17: *
18: * @since 3.3
19: */
20: public interface IJobRunnable {
21:
22: /**
23: * Executes this runnable. Returns the result of the execution.
24: * <p>
25: * The provided monitor can be used to report progress and respond to
26: * cancellation. If the progress monitor has been canceled, the runnable should
27: * finish its execution at the earliest convenience and return a result
28: * status of severity <code>IStatus.CANCEL</code>. The singleton cancel
29: * status <code>Status.CANCEL_STATUS</code> can be used for this purpose.
30: * <p>
31: *
32: * @param monitor
33: * the monitor to be used for reporting progress and responding
34: * to cancelation. The monitor is never <code>null</code>
35: * @return resulting status of the run. The result must not be
36: * <code>null</code>
37: */
38: public IStatus run(IProgressMonitor monitor);
39:
40: }
|