public static final class AsynchronousController.TaskInfo
extends java.lang.Object
implements org.openide.util.Cancellable
Modifier and Type | Method and Description |
---|---|
boolean |
cancel()
Cancels the task.
|
org.netbeans.api.progress.ProgressHandle |
createHandle(java.lang.String displayName,
boolean cancelable,
boolean modal)
Created a
ProgressHandle for informing user about how execution is
progressing. |
org.netbeans.api.progress.ProgressHandle |
createHandle(java.lang.String displayName,
boolean cancelable,
int waitCursorAfter,
int dialogAfter)
Created a
ProgressHandle for informing user about how execution is
progressing. |
org.netbeans.api.progress.ProgressHandle |
getHandle()
Must have been created otherwise returns null.
|
boolean |
isCancelled()
Test if the task has been canceled
|
WaitCursor |
showWaitCursor()
Shows a wait cursor (hourglass or other form) bould to
the main window of the IDE.
|
void |
waitFinished()
Waits (blocks) till the execution of the task is finished
i.e.
|
public final boolean isCancelled()
cancel()
has been called.public final boolean cancel()
isCancelled()
will return true. If the task has been set
to use Thread.interrupt()
this method will be called
on the thread handling the action.
It is up to the implementor of the handling method to test
often the isCancelled()
or Thread.isInterrupted()
handling InterruptedException
and associated exceptions
correctly and cancel the execution in such cases.cancel
in interface org.openide.util.Cancellable
public final void waitFinished()
cancel()
and exists.public final WaitCursor showWaitCursor()
public final org.netbeans.api.progress.ProgressHandle createHandle(java.lang.String displayName, boolean cancelable, boolean modal)
ProgressHandle
for informing user about how execution is
progressing.displayName
- Name/label of the handle.cancelable
- Should user be given a chance to cancel the operation.modal
- If true show a dialog (modal) of false show progress in
status bar and does not block interaction with the IDE.public final org.netbeans.api.progress.ProgressHandle createHandle(java.lang.String displayName, boolean cancelable, int waitCursorAfter, int dialogAfter)
ProgressHandle
for informing user about how execution is
progressing.displayName
- Name/label of the handle.cancelable
- Should user be given a chance to cancel the operation.waitCursorAfter
- cursor is changed to wait type when task is not finished in given number of milliseconds, use -1
for default 1000ms interval.dialogAfter
- progress dialog is going to show up when task is not finished in additional given number of milliseconds, use -1
value for additional 2000ms interval.public final org.netbeans.api.progress.ProgressHandle getHandle()