Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


oracle.ide.controls
Interface ProgressTracker


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

addTask

void addTask(ProgressTrackedTask task)
Adds a 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.
Parameters:
task -

addTask

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. 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.
Parameters:
task -
threadName -

getThread

java.lang.Thread getThread(ProgressTrackedTask task)
Gets the Thread used to run the given task.
Returns:
the thread used to run the given task or null if the task is completed

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


Copyright © 1997, 2012, Oracle. All rights reserved.