|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.ui.swt.progress.ProgressReportingManager
public class ProgressReportingManager
A manager that aggregates and forward progress information for long running operations
This is a non-intrusive implementation, such that, it does not directly manage any of the process; it simply receives and forwards information
The primary user of this class is the MainStatusBar
where it is used to display progress information
Field Summary | |
---|---|
static int |
COUNT_ACTIVE
|
static int |
COUNT_ALL
|
static int |
COUNT_ERROR
|
Fields inherited from interface org.gudy.azureus2.ui.swt.progress.IProgressReportConstants |
---|
AUTO_CLOSE, BORDER, MANAGER_EVENT_ADDED, MANAGER_EVENT_REMOVED, MANAGER_EVENT_UPDATED, MODAL, MSG_TYPE_ERROR, MSG_TYPE_INFO, MSG_TYPE_LOG, NONE, REPORT_TYPE_CANCEL, REPORT_TYPE_DISPOSED, REPORT_TYPE_DONE, REPORT_TYPE_ERROR, REPORT_TYPE_INIT, REPORT_TYPE_MODE_CHANGE, REPORT_TYPE_PROPERTY_CHANGED, REPORT_TYPE_RETRY, REPORTER_TYPE_DEFAULT, REPORTER_VISIBILITY_SYSTEM, REPORTER_VISIBILITY_USER, RETVAL_OK, RETVAL_OK_TO_DISPOSE, SHOW_TOOLBAR, STANDALONE |
Method Summary | |
---|---|
void |
addListener(IProgressReportingListener listener)
|
IProgressReporter |
addReporter()
|
IProgressReporter |
addReporter(java.lang.String name)
|
IProgressReporter |
getCurrentReporter()
Returns the current reporter, in other word, the last reporter to have reported anything |
static ProgressReportingManager |
getInstance()
|
IProgressReporter |
getNextActiveReporter()
Returns the next active reporter |
protected int |
getNextAvailableID()
Returns the next available ID that can be assigned to a ProgressReporter |
int |
getReporterCount(int whatToCount)
Returns the number of reporters that have sent any event to this manager and have not been removed COUNT_ERROR - count all reporters in error state
COUNT_ACTIVE - count all reporters that are still active
COUNT_ALL - count all reporters
|
java.util.List |
getReporters(boolean onlyActive)
Returns a modifiable list of ProgressReporter s; manipulating this list has no
effect on the internal list of reporters maintained by this manager |
IProgressReporter[] |
getReportersArray(boolean onlyActive)
Returns a modifiable array of ProgressReporter s; manipulating this array has no
effect on the internal list of reporters maintained by this manager |
boolean |
hasMultipleActive()
A convenience method for quickly determining whether more than one reporter is still active. |
protected void |
notifyManager(IProgressReporter reporter)
Push this reporter on top of the stack, and notifies any listeners that a state change has occurred |
boolean |
remove(IProgressReporter reporter)
Removes the given ProgressReporter from this manager. |
void |
removeListener(IProgressReportingListener listener)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int COUNT_ALL
public static final int COUNT_ACTIVE
public static final int COUNT_ERROR
Method Detail |
---|
public static final ProgressReportingManager getInstance()
public IProgressReporter addReporter()
public IProgressReporter addReporter(java.lang.String name)
public int getReporterCount(int whatToCount)
COUNT_ERROR
- count all reporters in error stateCOUNT_ACTIVE
- count all reporters that are still activeCOUNT_ALL
- count all reporters
whatToCount
- one of the above constants; will default to COUNT_ALL
if the parameter is unrecognized
public boolean hasMultipleActive()
#getReporterCount()
and inspecting the returned value
if the number of reporters is high since we may not have to go through the entire list before getting the result
true
if there are at least 2 active reporters; false
otherwisepublic IProgressReporter getNextActiveReporter()
null
if none are active or no reporters are foundpublic IProgressReporter getCurrentReporter()
null
if none are foundpublic java.util.List getReporters(boolean onlyActive)
ProgressReporter
s; manipulating this list has no
effect on the internal list of reporters maintained by this manager
onlyActive
- true
to filter the list to only include those reporters that are still active
ProgressReporter
where the oldest reporter would be at position 0public IProgressReporter[] getReportersArray(boolean onlyActive)
ProgressReporter
s; manipulating this array has no
effect on the internal list of reporters maintained by this manager
onlyActive
- true
to filter the array to only include those reporters that are still active
ProgressReporter
where the oldest reporter would be at position 0public boolean remove(IProgressReporter reporter)
ProgressReporter
from this manager. This has the effect that
any subsequent event reported by the same reporter will not be captured nor forwarded by this manager
reporter
-
public void addListener(IProgressReportingListener listener)
listener
- public void removeListener(IProgressReportingListener listener)
listener
- protected void notifyManager(IProgressReporter reporter)
reporter
- protected final int getNextAvailableID()
ProgressReporter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |