@Service public interface ProgressNotifier
Use this to notify the user that some long-running task is still running without either blocking the UI or forcing the user to wait in the same part of the application.
Obtain an instance of this via regular means (see Service
) and then
create and register(ProgressHandle)
an appropriate
ProgressHandle
.
An example of a simple progress notification that provides an indeterminate progress while the task is executing:
ProgressNotifier notifier = ... // get an instance
ProgressHandle handle = new ProgressHandle(new LocalizedString("test"));
handle.setIndeterminate(true);
handle.runTask(new Runnable() {
public void run {
// actual code to execute
}
});
Modifier and Type | Method and Description |
---|---|
boolean |
hasTasks() |
void |
register(ProgressHandle handle)
Register a handle that is used to communicate progress of tasks
|
void register(ProgressHandle handle)
boolean hasTasks()
Copyright © 2017. All rights reserved.