Always use a single WindowCache for the entire JVM
[egit/imyousuf.git] / org.spearce.jgit / src / org / spearce / jgit / lib / ProgressMonitor.java
blob72c513c8f6bcfa74e2d52eb5b06d13b5a2ab4b6d
1 /*
2 * Copyright (C) 2007 Robin Rosenberg
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License, version 2, as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
17 package org.spearce.jgit.lib;
19 /** A progress reporting interface. */
20 public interface ProgressMonitor {
21 /** Constant indicating the total work units cannot be predicted. */
22 public static final int UNKNOWN = 0;
24 /**
25 * Advise the monitor of the total number of subtasks.
26 * <p>
27 * This should be invoked at most once per progress monitor interface.
29 * @param totalTasks
30 * the total number of tasks the caller will need to complete
31 * their processing.
33 void start(int totalTasks);
35 /**
36 * Begin processing a single task.
38 * @param title
39 * title to describe the task. Callers should publish these as
40 * stable string constants that implementations could match
41 * against for translation support.
42 * @param totalWork
43 * total number of work units the application will perform;
44 * {@link #UNKNOWN} if it cannot be predicted in advance.
46 void beginTask(String title, int totalWork);
48 /**
49 * Denote that some work units have been completed.
50 * <p>
51 * This is an incremental update; if invoked once per work unit the correct
52 * value for our argument is <code>1</code>, to indicate a single unit of
53 * work has been finished by the caller.
55 * @param completed
56 * the number of work units completed since the last call.
58 void update(int completed);
60 /** Finish the current task, so the next can begin. */
61 void endTask();
63 /**
64 * Check for user task cancellation.
66 * @return true if the user asked the process to stop working.
68 boolean isCancelled();