public class ThreadedTaskController extends java.lang.Object implements Controller
| Modifier and Type | Class and Description | 
|---|---|
static interface  | 
ThreadedTaskController.ExceptionHandler
Handles exception that may happen during the execution of a threaded task. 
 | 
| Constructor and Description | 
|---|
ThreadedTaskController(java.util.concurrent.Callable<java.lang.Void> threadedTask,
                      java.lang.String taskMessage,
                      ThreadedTaskController.ExceptionHandler exceptionHandler,
                      UserPreferences preferences,
                      ViewFactory viewFactory)
Creates a controller that will execute in a separate thread the given task. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
cancelTask()
Cancels the threaded task if it's running. 
 | 
void | 
executeTask(View executingView)
Executes in a separate thread the task given in constructor. 
 | 
ThreadedTaskView | 
getView()
Returns the view controlled by this controller. 
 | 
boolean | 
isTaskRunning()
Returns  
true if the threaded task is running. | 
public ThreadedTaskController(java.util.concurrent.Callable<java.lang.Void> threadedTask,
                              java.lang.String taskMessage,
                              ThreadedTaskController.ExceptionHandler exceptionHandler,
                              UserPreferences preferences,
                              ViewFactory viewFactory)
Thread methods that the user may provoke
 when he wants to cancel a threaded task.public ThreadedTaskView getView()
getView in interface Controllerpublic void executeTask(View executingView)
public void cancelTask()
public boolean isTaskRunning()
true if the threaded task is running.
                        
© Copyright 2024 Space Mushrooms
                            
Distributed under GNU General Public License