A dialog window that performs an operation on a background thread. More...
Inherits AlertWindow, QuasiModalComponent, and AsyncUpdater.
Inherited by CodeReplacer, ExternalResourceCollector, FileImportDialogWindow, MultimicMergeDialogWindow, NormalizeThread, PresetLoadingThread, ReferenceFinder, SampleDataExporter, SampleDataImporter, SampleResolver, and SampleStartTrimmer.
Public Member Functions | |
virtual bool | checkConditionsBeforeStartingThread () |
If you want to check something (on the message thread) before launching the actual task, overwrite this method. More... | |
virtual void | resultButtonClicked (const String &) |
If you want to use a button for anything else than starting or cancelling, you can override this method and do whatever you need. More... | |
virtual void | run ()=0 |
Overwrite this method and do your thing. More... | |
void | runSynchronous () |
Starts the task synchronously. More... | |
void | runThread () |
Starts the thread. More... | |
void | setProgress (double progressValue) |
Sets the progressbar during job execution. More... | |
void | showStatusMessage (const String &message) const |
Shows a status message during job execution. More... | |
virtual void | threadFinished ()=0 |
This will be called after the thread has finished its task. More... | |
bool | threadShouldExit () const |
Checks if the thread should exist. More... | |
virtual | ~DialogWindowWithBackgroundThread () |
This stops the thread. More... | |
Protected Member Functions | |
void | addBasicComponents (bool addOkButton=true) |
Call this method in your constructor after you created all custom methods. More... | |
DialogWindowWithBackgroundThread (const String &title, bool synchronous=false) | |
Creates a new instance with the given title. More... | |
A dialog window that performs an operation on a background thread.
In order to use it, subclass it and overwrite the two callbacks run() and threadFinished().
Then simply create a instance and call its method 'setModalComponentOfMainEditor()'
|
virtual |
This stops the thread.
In order to avoid killing, check threadShouldExit() regularly in your run() method.
|
protected |
Creates a new instance with the given title.
Don't forget to call 'addBasicComponents' after you added your stuff.
|
protected |
Call this method in your constructor after you created all custom methods.
|
inlinevirtual |
If you want to check something (on the message thread) before launching the actual task, overwrite this method.
This will be called when the user presses OK. If you return false, it won't launch the process.
|
inlinevirtual |
If you want to use a button for anything else than starting or cancelling, you can override this method and do whatever you need.
The name is the same String that you specified with 'addButton()'
|
pure virtual |
Overwrite this method and do your thing.
void runSynchronous | ( | ) |
Starts the task synchronously.
void runThread | ( | ) |
Starts the thread.
|
inline |
Sets the progressbar during job execution.
void showStatusMessage | ( | const String & | message | ) | const |
Shows a status message during job execution.
|
pure virtual |
This will be called after the thread has finished its task.
It is called from the message loop so you can do some interface stuff without caring about the MessageManagerLock.
bool threadShouldExit | ( | ) | const |
Checks if the thread should exist.