Package org.eclipse.emf.common.util
Class BasicMonitor
java.lang.Object
org.eclipse.emf.common.util.BasicMonitor
- All Implemented Interfaces:
Monitor
- Direct Known Subclasses:
BasicMonitor.Printing
The most basic implementation of a task monitor.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA simple monitor that delegates to another monitor.static classAn Eclipse subprogress monitor that directly implements the monitor API.static classA simple monitor that prints progress to a print stream. -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled once per instance to indicate the name of the task and its expected duration.voidClears the reason for the activity being blocked.voiddone()Called to indicate the task is complete.Returns the current reason for task being blocked, ornull.voidinternalWorked(double work) Called by subprogress monitors to do fractional work.booleanReturns whether the activity has been canceled.voidsetBlocked(Diagnostic reason) Sets the reason for the activity being blocked.voidsetCanceled(boolean isCanceled) Sets whether the active should be canceled.voidsetTaskName(String name) Update the task name.static org.eclipse.core.runtime.IProgressMonitorWithBlockingsubProgress(org.eclipse.core.runtime.IProgressMonitor monitor, int ticks) Create a progress monitor that consumes the specified number of ticks.voidSets the current subtask of the overall task.static org.eclipse.core.runtime.IProgressMonitortoIProgressMonitor(Monitor monitor) Creates a delegating wrapper that allows the monitor to be used in a context requiring an instance implementing the Eclipse API.static org.eclipse.core.runtime.IProgressMonitorWithBlockingtoIProgressMonitorWithBlocking(Monitor monitor) Creates a delegating wrapper that allows the monitor to be used in a context requiring an instance implementing the Eclipse API.static MonitortoMonitor(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Creates a delegating wrapper that allows the Eclipse progress monitor to be used in a context requiring an instance implementing the monitor API.static MonitortoMonitor(org.eclipse.core.runtime.IProgressMonitorWithBlocking progressMonitor) Creates a delegating wrapper that allows the Eclipse progress monitor to be used in a context requiring an instance implementing the monitor API.voidworked(int work) Called to indicate the amount or progress on the task.
-
Constructor Details
-
BasicMonitor
public BasicMonitor()
-
-
Method Details
-
isCanceled
public boolean isCanceled()Description copied from interface:MonitorReturns whether the activity has been canceled.- Specified by:
isCanceledin interfaceMonitor
-
setCanceled
public void setCanceled(boolean isCanceled) Description copied from interface:MonitorSets whether the active should be canceled.- Specified by:
setCanceledin interfaceMonitor
-
getBlockedReason
Returns the current reason for task being blocked, ornull. -
setBlocked
Description copied from interface:MonitorSets the reason for the activity being blocked.- Specified by:
setBlockedin interfaceMonitor
-
clearBlocked
public void clearBlocked()Description copied from interface:MonitorClears the reason for the activity being blocked.- Specified by:
clearBlockedin interfaceMonitor
-
beginTask
Description copied from interface:MonitorCalled once per instance to indicate the name of the task and its expected duration. -
setTaskName
Description copied from interface:MonitorUpdate the task name.- Specified by:
setTaskNamein interfaceMonitor
-
subTask
Description copied from interface:MonitorSets the current subtask of the overall task. -
worked
public void worked(int work) Description copied from interface:MonitorCalled to indicate the amount or progress on the task. -
internalWorked
public void internalWorked(double work) Description copied from interface:MonitorCalled by subprogress monitors to do fractional work.- Specified by:
internalWorkedin interfaceMonitor
-
done
public void done()Description copied from interface:MonitorCalled to indicate the task is complete. -
toIProgressMonitor
Creates a delegating wrapper that allows the monitor to be used in a context requiring an instance implementing the Eclipse API. -
toIProgressMonitorWithBlocking
public static org.eclipse.core.runtime.IProgressMonitorWithBlocking toIProgressMonitorWithBlocking(Monitor monitor) Creates a delegating wrapper that allows the monitor to be used in a context requiring an instance implementing the Eclipse API. -
subProgress
public static org.eclipse.core.runtime.IProgressMonitorWithBlocking subProgress(org.eclipse.core.runtime.IProgressMonitor monitor, int ticks) Create a progress monitor that consumes the specified number of ticks.- Since:
- 2.13
-
toMonitor
public static Monitor toMonitor(org.eclipse.core.runtime.IProgressMonitorWithBlocking progressMonitor) Creates a delegating wrapper that allows the Eclipse progress monitor to be used in a context requiring an instance implementing the monitor API. -
toMonitor
Creates a delegating wrapper that allows the Eclipse progress monitor to be used in a context requiring an instance implementing the monitor API.
-