Class ProgramTask

  • All Implemented Interfaces:
    MonitoredRunnable
    Direct Known Subclasses:
    MoveBlockTask

    public abstract class ProgramTask
    extends Task
    Task for operating on programs. Will open and close a transaction around the work.
    • Field Detail

      • program

        protected Program program
    • Constructor Detail

      • ProgramTask

        protected ProgramTask​(Program program,
                              java.lang.String title,
                              boolean canCancel,
                              boolean hasProgress,
                              boolean isModal)
        Construct a new Task that will operate on a program.
        Parameters:
        program - the program that the task will operate on.
        title - title the title associated with the task
        canCancel - true means that the user can cancel the task
        hasProgress - true means that the dialog should show a progress indicator
        isModal - true means that the dialog is modal and the task has to complete or be canceled before any other action can occur
    • Method Detail

      • run

        public final void run​(TaskMonitor monitor)
        Description copied from class: Task
        This is the method that will be called to do the work

        Note: The run(TaskMonitor) method should not make any calls directly on Swing components, as these calls are not thread safe. Place Swing calls in a Runnable, then call SystemUtilities.runSwingLater(Runnable) or SystemUtilities.runSwingNow(Runnable)to schedule the Runnable inside of the AWT Event Thread.

        Specified by:
        run in class Task
        Parameters:
        monitor - The TaskMonitor that will monitor the executing Task
      • doRun

        protected abstract void doRun​(TaskMonitor monitor)