frameworkplugins/com.nokia.s60tools.util/src/com/nokia/s60tools/util/resource/IFileFinderObserver.java
changeset 0 61163b28edca
equal deleted inserted replaced
-1:000000000000 0:61163b28edca
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17  
       
    18  
       
    19 package com.nokia.s60tools.util.resource;
       
    20 
       
    21 import java.io.File;
       
    22 import java.util.Collection;
       
    23 
       
    24 import org.eclipse.core.runtime.IProgressMonitor;
       
    25 import org.eclipse.core.runtime.jobs.Job;
       
    26 
       
    27 /**
       
    28  * The implementation of this interface can observe the
       
    29  * completion and progress of the file finder tool
       
    30  * execution.
       
    31  */
       
    32 public interface IFileFinderObserver {
       
    33 	
       
    34 	
       
    35 	/**
       
    36 	 * Notifies that the main task is beginning.  This must only be called once
       
    37 	 * on a given progress monitor instance.
       
    38 	 * 
       
    39 	 * This call is meant to pass on to {@link IProgressMonitor#beginTask(String, int)}.
       
    40 	 * 
       
    41 	 * <p>Tip: If you want to do something else within same {@link Job} you
       
    42 	 * can increase the totalWork amount before giving it to {@link IProgressMonitor#beginTask(String, int)}.
       
    43 	 * 
       
    44 	 * @param name the name (or description) of the main task
       
    45 	 * @param steps the total number of work units into which
       
    46 	 *                  the main task is been subdivided. Allways returning {@link IFileFinderObserver#STEPS}.
       
    47 	 *  @see {@link IProgressMonitor#beginTask(String, int)}
       
    48 	 */	
       
    49 	public void beginTask(String name, int steps); 
       
    50 	
       
    51 	/**
       
    52 	 * Reports progress of a batch process like
       
    53 	 * execution. It depends on the invoked command
       
    54 	 * if any progress information can be gained. 
       
    55 	 * @param stepsCompleted how many of steps has been completed
       
    56 	 * @param taskName task name in progress.
       
    57 	 */
       
    58 	public void progress(int stepsCompleted, String taskName);
       
    59 	
       
    60 
       
    61 	/**
       
    62 	 * Informs the observer that the execution of the currently
       
    63 	 * executed command was interrupted due to some reason.
       
    64 	 * @param reasonMsg Message describing the reason. 
       
    65 	 */
       
    66 	public void interrupted(String reasonMsg);
       
    67 	
       
    68 	/**
       
    69 	 * Informs about the completion of the execution
       
    70 	 * of a single command.
       
    71 	 * @param exitValue Exit value of the executed command.
       
    72 	 * @param filePaths Collection of file objects found.
       
    73 	 */
       
    74 	public void completed(int exitValue, Collection<File> files);
       
    75 	
       
    76 	/**
       
    77 	 * Checks if the job is canceled.
       
    78 	 * This call is meant to pass on to {@link IProgressMonitor#isCanceled()}.
       
    79 	 * @return <code>true</code> if job is canceled, otherwise <code>false</code>.
       
    80 	 */
       
    81 	public boolean isCanceled();
       
    82 
       
    83 }