Class ValidationTask
- java.lang.Object
-
- org.openstreetmap.josm.gui.PleaseWaitRunnable
-
- org.openstreetmap.josm.data.validation.ValidationTask
-
- All Implemented Interfaces:
Runnable
,ProgressMonitor.CancelListener
public class ValidationTask extends PleaseWaitRunnable
Asynchronous task for running a collection of tests against a collection of primitives
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
canceled
private List<TestError>
errors
private Collection<OsmPrimitive>
formerValidatedPrimitives
private Collection<Test>
tests
private Collection<OsmPrimitive>
validatedPrimitives
-
Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor
-
-
Constructor Summary
Constructors Modifier Constructor Description ValidationTask(Collection<Test> tests, Collection<OsmPrimitive> validatedPrimitives, Collection<OsmPrimitive> formerValidatedPrimitives)
Constructs a newValidationTask
protected
ValidationTask(ProgressMonitor progressMonitor, Collection<Test> tests, Collection<OsmPrimitive> validatedPrimitives, Collection<OsmPrimitive> formerValidatedPrimitives)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cancel()
User pressed cancel button.protected void
finish()
Finish up the data work.List<TestError>
getErrors()
Gets the validation errors accumulated until this moment.protected void
realRun()
Called in the worker thread to do the actual work.-
Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
-
-
-
-
Field Detail
-
tests
private Collection<Test> tests
-
validatedPrimitives
private final Collection<OsmPrimitive> validatedPrimitives
-
formerValidatedPrimitives
private final Collection<OsmPrimitive> formerValidatedPrimitives
-
canceled
private boolean canceled
-
-
Constructor Detail
-
ValidationTask
public ValidationTask(Collection<Test> tests, Collection<OsmPrimitive> validatedPrimitives, Collection<OsmPrimitive> formerValidatedPrimitives)
Constructs a newValidationTask
- Parameters:
tests
- the tests to runvalidatedPrimitives
- the collection of primitives to validate.formerValidatedPrimitives
- the last collection of primitives being validates. May be null.
-
ValidationTask
protected ValidationTask(ProgressMonitor progressMonitor, Collection<Test> tests, Collection<OsmPrimitive> validatedPrimitives, Collection<OsmPrimitive> formerValidatedPrimitives)
-
-
Method Detail
-
cancel
protected void cancel()
Description copied from class:PleaseWaitRunnable
User pressed cancel button.- Specified by:
cancel
in classPleaseWaitRunnable
-
finish
protected void finish()
Description copied from class:PleaseWaitRunnable
Finish up the data work. Is guaranteed to be called if realRun is called. Finish is called in the gui thread just after the dialog disappeared.- Specified by:
finish
in classPleaseWaitRunnable
-
realRun
protected void realRun()
Description copied from class:PleaseWaitRunnable
Called in the worker thread to do the actual work. When any of the exception is thrown, a message box will be displayed and closeDialog is called. finish() is called in any case.- Specified by:
realRun
in classPleaseWaitRunnable
-
-