public class BasicMonitor extends java.lang.Object implements Monitor
| Modifier and Type | Class and Description |
|---|---|
static class |
BasicMonitor.Delegating
A simple monitor that delegates to another monitor.
|
static class |
BasicMonitor.EclipseSubProgress
An Eclipse subprogress monitor that directly implements the monitor API.
|
static class |
BasicMonitor.Printing
A simple monitor that prints progress to a print stream.
|
| Constructor and Description |
|---|
BasicMonitor() |
| Modifier and Type | Method and Description |
|---|---|
void |
beginTask(java.lang.String name,
int totalWork)
Called once per instance to indicate the name of the task and its expected duration.
|
void |
clearBlocked()
Clears the reason for the activity being blocked.
|
void |
done()
Called to indicate the task is complete.
|
Diagnostic |
getBlockedReason()
Returns the current reason for task being blocked, or
null. |
void |
internalWorked(double work)
Called by subprogress monitors to do fractional work.
|
boolean |
isCanceled()
Returns whether the activity has been canceled.
|
void |
setBlocked(Diagnostic reason)
Sets the reason for the activity being blocked.
|
void |
setCanceled(boolean isCanceled)
Sets whether the active should be canceled.
|
void |
setTaskName(java.lang.String name)
Update the task name.
|
static IProgressMonitorWithBlocking |
subProgress(IProgressMonitor monitor,
int ticks)
Create a progress monitor that consumes the specified number of ticks.
|
void |
subTask(java.lang.String name)
Sets the current subtask of the overall task.
|
static IProgressMonitor |
toIProgressMonitor(Monitor monitor)
Creates a delegating wrapper that allows the monitor to be used
in a context requiring an instance implementing the Eclipse API.
|
static 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.
|
static Monitor |
toMonitor(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 Monitor |
toMonitor(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.
|
void |
worked(int work)
Called to indicate the amount or progress on the task.
|
public boolean isCanceled()
MonitorisCanceled in interface Monitorpublic void setCanceled(boolean isCanceled)
MonitorsetCanceled in interface Monitorpublic Diagnostic getBlockedReason()
null.public void setBlocked(Diagnostic reason)
MonitorsetBlocked in interface Monitorpublic void clearBlocked()
MonitorclearBlocked in interface Monitorpublic void beginTask(java.lang.String name,
int totalWork)
Monitorpublic void setTaskName(java.lang.String name)
MonitorsetTaskName in interface Monitorpublic void subTask(java.lang.String name)
Monitorpublic void worked(int work)
Monitorpublic void internalWorked(double work)
MonitorinternalWorked in interface Monitorpublic void done()
Monitorpublic static IProgressMonitor toIProgressMonitor(Monitor monitor)
public static IProgressMonitorWithBlocking toIProgressMonitorWithBlocking(Monitor monitor)
public static IProgressMonitorWithBlocking subProgress(IProgressMonitor monitor,
int ticks)
public static Monitor toMonitor(IProgressMonitorWithBlocking progressMonitor)
public static Monitor toMonitor(IProgressMonitor progressMonitor)
Copyright © 2018. Licensed under the Eclipse Public License v1.0. All rights reserved.
Submit a bug or feature