Interface MonitorReceiver
TaskMonitor
This only gives a subset of the expected task monitor interface. This is the subset a user would need to monitor and/or cancel the task. All the mechanisms for updating the monitor are only available to the publishing client.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Request the task be cancelledlongGet the maximum value of progressGet the current message for the monitorlongGet the progress value, if applicablebooleanCheck if the task can be cancelledbooleanCheck if the task is cancelledbooleanCheck if the monitor indicates progress at allbooleanCheck if the monitor should be rendered with the progress valuebooleanisValid()Check if the monitor is still valid
-
Method Details
-
getMessage
String getMessage()Get the current message for the monitor- Returns:
- the message
-
isIndeterminate
boolean isIndeterminate()Check if the monitor indicates progress at allIf the task is indeterminate, then its
getMaximum()andgetProgress()methods are meaningless.- Returns:
- true if indeterminate (no progress shown), false if determinate (progress shown)
-
getMaximum
long getMaximum()Get the maximum value of progressThe implication is that when
getProgress()returns the maximum, the task is complete.- Returns:
- the maximum progress
-
getProgress
long getProgress()Get the progress value, if applicable- Returns:
- the progress, or
TaskMonitor.NO_PROGRESS_VALUEif un-set or not applicable
-
isCancelEnabled
boolean isCancelEnabled()Check if the task can be cancelled- Returns:
- true if cancel is enabled, false if not
-
cancel
void cancel()Request the task be cancelledNote it is up to the client publishing the task to adhere to this request. In general, the computation should occasionally call
TaskMonitor.checkCancelled(). In particular, the subscribing client cannot presume the task is cancelled purely by virtue of calling this method successfully. Instead, it should listen forProgressListener.monitorDisposed(MonitorReceiver, Disposal). -
isCancelled
boolean isCancelled()Check if the task is cancelled- Returns:
- true if cancelled, false if not
-
isValid
boolean isValid()Check if the monitor is still validA monitor becomes invalid when it is closed or cleaned.
- Returns:
- true if still valid, false if invalid
-
isShowProgressValue
boolean isShowProgressValue()Check if the monitor should be rendered with the progress valueRegardless of this value, the monitor will render a progress bar and a numeric percentage. If this is set to true (the default), the it will also display "{progress} of {maximum}" in text.
- Returns:
- true to render the actual progress value, false for only a percentage.
-