Class BasicMonitor

java.lang.Object
org.eclipse.emf.common.util.BasicMonitor
All Implemented Interfaces:
Monitor
Direct Known Subclasses:
BasicMonitor.Printing

public class BasicMonitor extends Object implements Monitor
The most basic implementation of a task monitor.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    A simple monitor that delegates to another monitor.
    static class 
    An Eclipse subprogress monitor that directly implements the monitor API.
    static class 
    A simple monitor that prints progress to a print stream.
  • Field Summary

    Fields inherited from interface org.eclipse.emf.common.util.Monitor

    UNKNOWN
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    beginTask(String name, int totalWork)
    Called once per instance to indicate the name of the task and its expected duration.
    void
    Clears the reason for the activity being blocked.
    void
    Called to indicate the task is complete.
    Returns the current reason for task being blocked, or null.
    void
    internalWorked(double work)
    Called by subprogress monitors to do fractional work.
    boolean
    Returns whether the activity has been canceled.
    void
    Sets the reason for the activity being blocked.
    void
    setCanceled(boolean isCanceled)
    Sets whether the active should be canceled.
    void
    Update the task name.
    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.
    void
    Sets the current subtask of the overall task.
    static org.eclipse.core.runtime.IProgressMonitor
    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.IProgressMonitorWithBlocking
    Creates a delegating wrapper that allows the monitor to be used in a context requiring an instance implementing the Eclipse API.
    static Monitor
    toMonitor(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 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.
    void
    worked(int work)
    Called to indicate the amount or progress on the task.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BasicMonitor

      public BasicMonitor()
  • Method Details

    • isCanceled

      public boolean isCanceled()
      Description copied from interface: Monitor
      Returns whether the activity has been canceled.
      Specified by:
      isCanceled in interface Monitor
    • setCanceled

      public void setCanceled(boolean isCanceled)
      Description copied from interface: Monitor
      Sets whether the active should be canceled.
      Specified by:
      setCanceled in interface Monitor
    • getBlockedReason

      public Diagnostic getBlockedReason()
      Returns the current reason for task being blocked, or null.
    • setBlocked

      public void setBlocked(Diagnostic reason)
      Description copied from interface: Monitor
      Sets the reason for the activity being blocked.
      Specified by:
      setBlocked in interface Monitor
    • clearBlocked

      public void clearBlocked()
      Description copied from interface: Monitor
      Clears the reason for the activity being blocked.
      Specified by:
      clearBlocked in interface Monitor
    • beginTask

      public void beginTask(String name, int totalWork)
      Description copied from interface: Monitor
      Called once per instance to indicate the name of the task and its expected duration.
      Specified by:
      beginTask in interface Monitor
    • setTaskName

      public void setTaskName(String name)
      Description copied from interface: Monitor
      Update the task name.
      Specified by:
      setTaskName in interface Monitor
    • subTask

      public void subTask(String name)
      Description copied from interface: Monitor
      Sets the current subtask of the overall task.
      Specified by:
      subTask in interface Monitor
    • worked

      public void worked(int work)
      Description copied from interface: Monitor
      Called to indicate the amount or progress on the task.
      Specified by:
      worked in interface Monitor
    • internalWorked

      public void internalWorked(double work)
      Description copied from interface: Monitor
      Called by subprogress monitors to do fractional work.
      Specified by:
      internalWorked in interface Monitor
    • done

      public void done()
      Description copied from interface: Monitor
      Called to indicate the task is complete.
      Specified by:
      done in interface Monitor
    • toIProgressMonitor

      public static org.eclipse.core.runtime.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.
    • 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

      public static Monitor toMonitor(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.