Package org.topbraid.jenax.progress
Class NullProgressMonitor
- java.lang.Object
-
- org.topbraid.jenax.progress.NullProgressMonitor
-
- All Implemented Interfaces:
ProgressMonitor
public class NullProgressMonitor extends Object implements ProgressMonitor
A ProgressMonitor that doesn't "do" anything. Support for canceling is provided viasetCanceled.- Author:
- Holger Knublauch
-
-
Constructor Summary
Constructors Constructor Description NullProgressMonitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginTask(String label, int totalWork)Informs the progress monitor that a new task has been started, with a given number of expected steps.voiddone()Informs the progress monitor that all is completed.booleanisCanceled()Typically used by the (long-running) process to determine whether the user has requested cancellation.voidsetCanceled(boolean value)Typically called from a parallel thread triggered by the user, this informs the progress monitor that it needs to returntrueforisCanceled.voidsetTaskName(String value)Changes the name or label of the current task.voidsubTask(String label)Sets the label that serves as sub-task, typically printed under the main task name.voidworked(int amount)Informs the progress monitor that one or more steps have been completed towards the current task (seebeginTask).
-
-
-
Method Detail
-
isCanceled
public boolean isCanceled()
Description copied from interface:ProgressMonitorTypically used by the (long-running) process to determine whether the user has requested cancellation. The process should then find a suitable, clean termination.- Specified by:
isCanceledin interfaceProgressMonitor- Returns:
- true if cancel was requested
-
beginTask
public void beginTask(String label, int totalWork)
Description copied from interface:ProgressMonitorInforms the progress monitor that a new task has been started, with a given number of expected steps. A UI connected to the ProgressMonitor would typically display something like a progress bar and the task name.- Specified by:
beginTaskin interfaceProgressMonitor- Parameters:
label- the name of the tasktotalWork- the number of steps (seeworked) that is expected to be needed to complete the task
-
done
public void done()
Description copied from interface:ProgressMonitorInforms the progress monitor that all is completed.- Specified by:
donein interfaceProgressMonitor
-
setCanceled
public void setCanceled(boolean value)
Description copied from interface:ProgressMonitorTypically called from a parallel thread triggered by the user, this informs the progress monitor that it needs to returntrueforisCanceled. Once a process has been canceled, it should not be un-canceled.- Specified by:
setCanceledin interfaceProgressMonitor- Parameters:
value- true if canceled
-
setTaskName
public void setTaskName(String value)
Description copied from interface:ProgressMonitorChanges the name or label of the current task.- Specified by:
setTaskNamein interfaceProgressMonitor
-
subTask
public void subTask(String label)
Description copied from interface:ProgressMonitorSets the label that serves as sub-task, typically printed under the main task name.- Specified by:
subTaskin interfaceProgressMonitor- Parameters:
label- the subtask label
-
worked
public void worked(int amount)
Description copied from interface:ProgressMonitorInforms the progress monitor that one or more steps have been completed towards the current task (seebeginTask).- Specified by:
workedin interfaceProgressMonitor- Parameters:
amount- the number of steps completed
-
-