Package org.eclipse.jgit.lib
Class EmptyProgressMonitor
java.lang.Object
org.eclipse.jgit.lib.EmptyProgressMonitor
- All Implemented Interfaces:
ProgressMonitor
A convenient base class which provides empty method bodies for all
ProgressMonitor methods.
Could be used in scenarios when only some of the progress notifications are important and others can be ignored.
-
Field Summary
Fields inherited from interface org.eclipse.jgit.lib.ProgressMonitor
UNKNOWN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBegin processing a single task.voidendTask()Finish the current task, so the next can begin.booleanCheck for user task cancellation.voidstart(int totalTasks) Advise the monitor of the total number of subtasks.voidupdate(int completed) Denote that some work units have been completed.
-
Constructor Details
-
EmptyProgressMonitor
public EmptyProgressMonitor()
-
-
Method Details
-
start
public void start(int totalTasks) Advise the monitor of the total number of subtasks.This should be invoked at most once per progress monitor interface.
- Specified by:
startin interfaceProgressMonitor- Parameters:
totalTasks- the total number of tasks the caller will need to complete their processing.
-
beginTask
Begin processing a single task.- Specified by:
beginTaskin interfaceProgressMonitor- Parameters:
title- title to describe the task. Callers should publish these as stable string constants that implementations could match against for translation support.totalWork- total number of work units the application will perform;ProgressMonitor.UNKNOWNif it cannot be predicted in advance.
-
update
public void update(int completed) Denote that some work units have been completed.This is an incremental update; if invoked once per work unit the correct value for our argument is
1, to indicate a single unit of work has been finished by the caller.- Specified by:
updatein interfaceProgressMonitor- Parameters:
completed- the number of work units completed since the last call.
-
endTask
public void endTask()Finish the current task, so the next can begin.- Specified by:
endTaskin interfaceProgressMonitor
-
isCancelled
public boolean isCancelled()Check for user task cancellation.- Specified by:
isCancelledin interfaceProgressMonitor- Returns:
- true if the user asked the process to stop working.
-