public abstract class AsyncDialogTask extends Object implements IAsyncRunnable
| Constructor and Description |
|---|
AsyncDialogTask() |
| Modifier and Type | Method and Description |
|---|---|
protected QDataContext |
dc() |
protected abstract void |
execute(IProgress progress) |
protected ILogicContext |
lc() |
void |
onCompleted(boolean cancelled,
Exception errorException)
This method gets called with your originating DomUI page "active" when the activity has completed.
|
void |
run(IProgress p)
This is the code to call on the newly created worker thread - it should do the long running task that
you want to execute in parallel.
|
static void |
runInDialog(NodeContainer addTo,
AsyncDialogTask task,
String dialogTitle,
boolean isAbortable,
boolean autoClose) |
protected abstract void execute(@Nonnull IProgress progress) throws Exception
Exceptionpublic void run(@Nonnull IProgress p) throws Exception
IAsyncRunnableQContextManager.createUnmanagedContext() or
something similar to create a context usable within this task - and do not forget to release it either!IAsyncRunnable.onCompleted(boolean, Exception), and use
properly synchronized(!) member variables in your IAsyncRunnable implementation to create the new UI to show
after the task.run in interface IAsyncRunnableException@Nonnull protected QDataContext dc() throws Exception
Exception@Nonnull protected ILogicContext lc() throws Exception
Exceptionpublic void onCompleted(boolean cancelled,
@Nullable
Exception errorException)
throws Exception
IAsyncRunnableonCompleted in interface IAsyncRunnablecancelled - When TRUE, the task was cancelled by the user.errorException - When non-null the IAsyncRunnable.run(IProgress) method terminated with an exception, and this is
that exception. You are supposed to do something with it since no other indication
of that error is reported to the user!! So throw this exception on, or display it on your page.Exceptionpublic static void runInDialog(@Nonnull NodeContainer addTo, @Nonnull AsyncDialogTask task, @Nonnull String dialogTitle, boolean isAbortable, boolean autoClose)
Copyright © 2017 etc.to. All rights reserved.