Package org.openstreetmap.josm.gui.io
Class SaveLayerTask
- java.lang.Object
-
- org.openstreetmap.josm.gui.io.AbstractIOTask
-
- org.openstreetmap.josm.gui.io.SaveLayerTask
-
- All Implemented Interfaces:
Runnable
public class SaveLayerTask extends AbstractIOTask
SaveLayerTask saves the data managed by anAbstractModifiableLayer
to theLayer.getAssociatedFile()
.ExecutorService executorService = ... SaveLayerTask task = new SaveLayerTask(layer, monitor); Future<?> taskFuture = executorService.submit(task) try { // wait for the task to complete taskFuture.get(); } catch (Exception e) { e.printStackTrace(); }
-
-
Field Summary
Fields Modifier and Type Field Description private SaveLayerInfo
layerInfo
private ProgressMonitor
parentMonitor
-
Constructor Summary
Constructors Modifier Constructor Description protected
SaveLayerTask(SaveLayerInfo layerInfo, ProgressMonitor monitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
Cancel the taskvoid
run()
-
Methods inherited from class org.openstreetmap.josm.gui.io.AbstractIOTask
getLastException, isCanceled, isFailed, isSuccessful, setCanceled, setFailed, setLastException
-
-
-
-
Field Detail
-
layerInfo
private final SaveLayerInfo layerInfo
-
parentMonitor
private final ProgressMonitor parentMonitor
-
-
Constructor Detail
-
SaveLayerTask
protected SaveLayerTask(SaveLayerInfo layerInfo, ProgressMonitor monitor)
- Parameters:
layerInfo
- information about the layer to be saved to save. Must not be null.monitor
- the monitor. Set toNullProgressMonitor.INSTANCE
if null- Throws:
IllegalArgumentException
- if layer is null
-
-
Method Detail
-
run
public void run()
-
cancel
public void cancel()
Description copied from class:AbstractIOTask
Cancel the task- Specified by:
cancel
in classAbstractIOTask
-
-