edu.rice.cs.drjava.ui
Class MainFrame.DJAsyncTaskLauncher

java.lang.Object
  extended by edu.rice.cs.util.swing.AsyncTaskLauncher
      extended by edu.rice.cs.drjava.ui.MainFrame.DJAsyncTaskLauncher
Enclosing class:
MainFrame

private class MainFrame.DJAsyncTaskLauncher
extends AsyncTaskLauncher

Author:
jlugo

Constructor Summary
private MainFrame.DJAsyncTaskLauncher()
           
 
Method Summary
protected  IAsyncProgress createProgressMonitor(String description, int min, int max)
          Creates a progress monitor that can be used to provide feedback to the user during the asynchronous task.
protected  void setParentContainerEnabled(boolean enabled)
          Sets the enabled state of the parent component.
protected  boolean shouldSetEnabled()
          Returns whether the launcher should call setParentContainerEnabled both to disable and to re-enable the parent.
 
Methods inherited from class edu.rice.cs.util.swing.AsyncTaskLauncher
executeTask
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MainFrame.DJAsyncTaskLauncher

private MainFrame.DJAsyncTaskLauncher()
Method Detail

shouldSetEnabled

protected boolean shouldSetEnabled()
Description copied from class: AsyncTaskLauncher
Returns whether the launcher should call setParentContainerEnabled both to disable and to re-enable the parent. This facility gives launchers more control over the view in case dissabling or re-enabling the view produces inconsistent behavior.

In some cases, this method should always return true, e.g., when for each call to lock the UI, you must call the unlock method an equal number of times to actually unlock the frame. If this were dissabling a normal swing component, where can only be on/off, you wouldn't want to re-enable the component if it was already disabled.

Specified by:
shouldSetEnabled in class AsyncTaskLauncher
Returns:
whether the launcher should call setParentContainerEnabled

setParentContainerEnabled

protected void setParentContainerEnabled(boolean enabled)
Description copied from class: AsyncTaskLauncher
Sets the enabled state of the parent component. When the parent component is dissabled, the user cannot invoke any operations via mouse clicks or key strokes. Note: this method only runs in the event thread.

Specified by:
setParentContainerEnabled in class AsyncTaskLauncher
Parameters:
enabled - Whether the parent container should be enabled

createProgressMonitor

protected IAsyncProgress createProgressMonitor(String description,
                                               int min,
                                               int max)
Description copied from class: AsyncTaskLauncher
Creates a progress monitor that can be used to provide feedback to the user during the asynchronous task. This progress monitor can also be used to allow the user to request the task to be canceled.

This method only executes in the event-handling thread.

Specified by:
createProgressMonitor in class AsyncTaskLauncher
Returns:
The progress monitor used to provide feedback.