PTP
Release 7.0

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

java.lang.Object
  extended by org.eclipse.ptp.rdt.sync.core.RecursiveSubMonitor
All Implemented Interfaces:
org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IProgressMonitorWithBlocking

public class RecursiveSubMonitor
extends java.lang.Object
implements org.eclipse.core.runtime.IProgressMonitorWithBlocking

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

Field Summary
 
Fields inherited from interface org.eclipse.core.runtime.IProgressMonitor
UNKNOWN
 
Method Summary
 void beginTask(java.lang.String name, int totalWork)
           
 void clearBlocked()
           
static RecursiveSubMonitor convert(org.eclipse.core.runtime.IProgressMonitor monitor)
          Convert the underlying submonitor as before but wrap it in a recursive submonitor.
static RecursiveSubMonitor convert(org.eclipse.core.runtime.IProgressMonitor monitor, int work)
          Convert the underlying submonitor as before but wrap it in a recursive submonitor.
static RecursiveSubMonitor convert(org.eclipse.core.runtime.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(org.eclipse.core.runtime.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

Specified by:
subTask in interface org.eclipse.core.runtime.IProgressMonitor
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(org.eclipse.core.runtime.IProgressMonitor monitor)
Convert the underlying submonitor as before but wrap it in a recursive submonitor.

Parameters:
monitor -
Returns:

convert

public static RecursiveSubMonitor convert(org.eclipse.core.runtime.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(org.eclipse.core.runtime.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()
Specified by:
isCanceled in interface org.eclipse.core.runtime.IProgressMonitor

setTaskName

public void setTaskName(java.lang.String name)
Specified by:
setTaskName in interface org.eclipse.core.runtime.IProgressMonitor

beginTask

public void beginTask(java.lang.String name,
                      int totalWork)
Specified by:
beginTask in interface org.eclipse.core.runtime.IProgressMonitor

done

public void done()
Specified by:
done in interface org.eclipse.core.runtime.IProgressMonitor

internalWorked

public void internalWorked(double work)
Specified by:
internalWorked in interface org.eclipse.core.runtime.IProgressMonitor

worked

public void worked(int work)
Specified by:
worked in interface org.eclipse.core.runtime.IProgressMonitor

setCanceled

public void setCanceled(boolean b)
Specified by:
setCanceled in interface org.eclipse.core.runtime.IProgressMonitor

clearBlocked

public void clearBlocked()
Specified by:
clearBlocked in interface org.eclipse.core.runtime.IProgressMonitorWithBlocking

setBlocked

public void setBlocked(org.eclipse.core.runtime.IStatus reason)
Specified by:
setBlocked in interface org.eclipse.core.runtime.IProgressMonitorWithBlocking

PTP
Release 7.0

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