PTP
Release 7.0

org.eclipse.ptp.rdt.sync.core
Class RecursiveSubMonitor

java.lang.Object
  extended by org.eclipse.ptp.rdt.sync.core.RecursiveSubMonitor

public class RecursiveSubMonitor
extends java.lang.Object

Submonitor capable of recursive task reporting. New subtasks are appended to the parent's subtask. Operates as a thin wrapper around the usual tree of submonitors, which still do most of the work.

Since:
3.0

Method Summary
 void beginTask(java.lang.String name, int totalWork)
           
 void clearBlocked()
           
static RecursiveSubMonitor convert(IProgressMonitor monitor)
          Convert the underlying submonitor as before but wrap it in a recursive submonitor.
static RecursiveSubMonitor convert(IProgressMonitor monitor, int work)
          Convert the underlying submonitor as before but wrap it in a recursive submonitor.
static RecursiveSubMonitor convert(IProgressMonitor monitor, java.lang.String taskName, int work)
          Convert the underlying submonitor as before but wrap it in a recursive submonitor.
 void done()
           
 RecursiveSubMonitor getParentMonitor()
          Return parent monitor or null if parent does not exist or is not a RecursiveSubMonitor
 java.lang.String getSubTaskName()
          Get the name of the subtask - trivial but essential for recursive task reporting to work
 void internalWorked(double work)
           
 boolean isCanceled()
           
 RecursiveSubMonitor newChild(int totalWork)
          Intercept creating of child monitors to store the parent in the new monitor
 RecursiveSubMonitor newChild(int totalWork, int suppressFlags)
          Intercept creating of child monitors to store the parent in the new monitor
 void setBlocked(IStatus reason)
           
 void setCanceled(boolean b)
           
 void setTaskName(java.lang.String name)
           
 RecursiveSubMonitor setWorkRemaining(int workRemaining)
           
 void subTask(java.lang.String name)
          Intercept setting of subtask name to store it and prepend parent's subtask
 void worked(int work)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSubTaskName

public java.lang.String getSubTaskName()
Get the name of the subtask - trivial but essential for recursive task reporting to work

Returns:
name of subtask

getParentMonitor

public RecursiveSubMonitor getParentMonitor()
Return parent monitor or null if parent does not exist or is not a RecursiveSubMonitor

Returns:
parent

subTask

public void subTask(java.lang.String name)
Intercept setting of subtask name to store it and prepend parent's subtask

Parameters:
name -

newChild

public RecursiveSubMonitor newChild(int totalWork)
Intercept creating of child monitors to store the parent in the new monitor

Parameters:
totalWork -
Returns:
new monitor

newChild

public RecursiveSubMonitor newChild(int totalWork,
                                    int suppressFlags)
Intercept creating of child monitors to store the parent in the new monitor

Parameters:
totalWork -
suppressFlags -
Returns:
new monitor

convert

public static RecursiveSubMonitor convert(IProgressMonitor monitor)
Convert the underlying submonitor as before but wrap it in a recursive submonitor.

Parameters:
monitor -
Returns:

convert

public static RecursiveSubMonitor convert(IProgressMonitor monitor,
                                          int work)
Convert the underlying submonitor as before but wrap it in a recursive submonitor.

Parameters:
monitor -
Returns:

convert

public static RecursiveSubMonitor convert(IProgressMonitor monitor,
                                          java.lang.String taskName,
                                          int work)
Convert the underlying submonitor as before but wrap it in a recursive submonitor.

Parameters:
monitor -
Returns:

setWorkRemaining

public RecursiveSubMonitor setWorkRemaining(int workRemaining)

isCanceled

public boolean isCanceled()

setTaskName

public void setTaskName(java.lang.String name)

beginTask

public void beginTask(java.lang.String name,
                      int totalWork)

done

public void done()

internalWorked

public void internalWorked(double work)

worked

public void worked(int work)

setCanceled

public void setCanceled(boolean b)

clearBlocked

public void clearBlocked()

setBlocked

public void setBlocked(IStatus reason)

PTP
Release 7.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.