public abstract class PleaseWaitRunnable
extends java.lang.Object
implements java.lang.Runnable, org.openstreetmap.josm.gui.progress.ProgressMonitor.CancelListener
Modifier and Type | Field and Description |
---|---|
protected org.openstreetmap.josm.gui.progress.ProgressMonitor |
progressMonitor |
Constructor and Description |
---|
PleaseWaitRunnable(java.awt.Component parent,
java.lang.String title,
boolean ignoreException)
Create the runnable object with a given message for the user
|
PleaseWaitRunnable(java.lang.String title)
Create the runnable object with a given message for the user.
|
PleaseWaitRunnable(java.lang.String title,
boolean ignoreException)
Create the runnable object with a given message for the user.
|
PleaseWaitRunnable(java.lang.String title,
org.openstreetmap.josm.gui.progress.ProgressMonitor progressMonitor,
boolean ignoreException) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterFinish()
Can be overriden if something needs to run after progress monitor is closed.
|
protected abstract void |
cancel()
User pressed cancel button.
|
org.openstreetmap.josm.gui.progress.ProgressTaskId |
canRunInBackground()
Task can run in background if returned value <> null.
|
protected abstract void |
finish()
Finish up the data work.
|
org.openstreetmap.josm.gui.progress.ProgressMonitor |
getProgressMonitor() |
void |
operationCanceled() |
protected abstract void |
realRun()
Called in the worker thread to do the actual work.
|
void |
run() |
protected final org.openstreetmap.josm.gui.progress.ProgressMonitor progressMonitor
public PleaseWaitRunnable(java.lang.String title)
public PleaseWaitRunnable(java.lang.String title, boolean ignoreException)
title
- message for the userignoreException
- If true, exception will be propagated to calling code. If false then
exception will be thrown directly in EDT. When this runnable is executed using executor framework
then use false unless you read result of task (because exception will get lost if you don't)public PleaseWaitRunnable(java.awt.Component parent, java.lang.String title, boolean ignoreException) throws java.lang.IllegalArgumentException
parent
- the parent component for the please wait dialog. Must not be null.title
- message for the userignoreException
- If true, exception will be propagated to calling code. If false then
exception will be thrown directly in EDT. When this runnable is executed using executor framework
then use false unless you read result of task (because exception will get lost if you don't)java.lang.IllegalArgumentException
- thrown if parent is nullpublic PleaseWaitRunnable(java.lang.String title, org.openstreetmap.josm.gui.progress.ProgressMonitor progressMonitor, boolean ignoreException)
protected void afterFinish()
public final void run()
run
in interface java.lang.Runnable
public void operationCanceled()
operationCanceled
in interface org.openstreetmap.josm.gui.progress.ProgressMonitor.CancelListener
protected abstract void cancel()
protected abstract void realRun() throws org.xml.sax.SAXException, java.io.IOException, org.openstreetmap.josm.io.OsmTransferException
org.xml.sax.SAXException
java.io.IOException
org.openstreetmap.josm.io.OsmTransferException
protected abstract void finish()
public org.openstreetmap.josm.gui.progress.ProgressMonitor getProgressMonitor()
public org.openstreetmap.josm.gui.progress.ProgressTaskId canRunInBackground()