1 /******************************************************************************* 2 * Copyright (c) 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 12 package org.eclipse.ui.progress; 13 14 import org.eclipse.core.runtime.IProgressMonitor; 15 import org.eclipse.core.runtime.IStatus; 16 17 /** 18 * Interface for runnables that can be run as jobs. 19 * 20 * @since 3.3 21 */ 22 public interface IJobRunnable { 23 24 /** 25 * Executes this runnable. Returns the result of the execution. 26 * <p> 27 * The provided monitor can be used to report progress and respond to 28 * cancellation. If the progress monitor has been canceled, the runnable should 29 * finish its execution at the earliest convenience and return a result 30 * status of severity <code>IStatus.CANCEL</code>. The singleton cancel 31 * status <code>Status.CANCEL_STATUS</code> can be used for this purpose. 32 * <p> 33 * 34 * @param monitor 35 * the monitor to be used for reporting progress and responding 36 * to cancelation. The monitor is never <code>null</code> 37 * @return resulting status of the run. The result must not be 38 * <code>null</code> 39 */ 40 public IStatus run(IProgressMonitor monitor); 41 42 } 43