|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ProgressTracker
The ProgressTracker interface provides a way to have progress indicated in the IDE status bar for background tasks.
The following is an example of using the interface for a background task whose progress cannot be determined. // Get the progress Tracker ProgressTracker tracker = ProgressTracker.getProgressTracker(); tracker.addTask(new ProgressTrackedTask() { public boolean isIndeterminate() { return true; } public void run() { <perform the work here> } public int getCurrentValue() { return 0; } public int getMinimum() { return 0; } public int getMaximum() { return 0; } public String getCurrentText() { return null; } public String getTaskDescription() { return "MyBackgroundTask"; } });
Here's an example when progress can be determined: // Get the progress Tracker ProgressTracker tracker = ProgressTracker.getProgressTracker(); tracker.addTask(new MyTrackedTask()); } private static class MyTrackedTask implements ProgressTrackedTask { private int _curValue = 0; public boolean isIndeterminate() { return false; } public void run() { for (int i=0; i<100; i++) { _curValue = i; } } public int getCurrentValue() { return _curValue; } public int getMinimum() { return 0; } public int getMaximum() { return 99; } public String getCurrentText() { return null; } public String getTaskDescription() { return "MyBackgroundTask"; } }
| Method Summary | |
|---|---|
void |
addTask(ProgressTrackedTask task)Adds a ProgressTrackedTask to the set of tasks whose progress is displayed in the IDE's status bar. |
void |
addTask(ProgressTrackedTask task, java.lang.String threadName)Adds a ProgressTrackedTask to the set of tasks whose progress is displayed in the IDE's status bar. |
java.lang.Thread |
getThread(ProgressTrackedTask task)Gets the Thread used to run the given task. |
| Method Detail |
|---|
void addTask(ProgressTrackedTask task)
ProgressTrackedTask to the set of tasks whose progress is displayed in the IDE's status bar. The ProgressTracker will create a Thread for the task, start the thread, and remove the task when the thread is completed.task -
void addTask(ProgressTrackedTask task,
java.lang.String threadName)
ProgressTrackedTask to the set of tasks whose progress is displayed in the IDE's status bar. The ProgressTracker will create a Thread with the give name for the task, start the thread, and remove the task when the thread is completed.task -threadName -java.lang.Thread getThread(ProgressTrackedTask task)
Thread used to run the given task.
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||