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:
java.lang.Runnable
public class SaveLayerTask extends AbstractIOTask
SaveLayerTask saves the data managed by anAbstractModifiableLayerto 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 SaveLayerInfolayerInfoprivate ProgressMonitorparentMonitor
-
Constructor Summary
Constructors Modifier Constructor Description protectedSaveLayerTask(SaveLayerInfo layerInfo, ProgressMonitor monitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Cancel the taskvoidrun()-
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.INSTANCEif null- Throws:
java.lang.IllegalArgumentException- if layer is null
-
-
Method Detail
-
run
public void run()
-
cancel
public void cancel()
Description copied from class:AbstractIOTaskCancel the task- Specified by:
cancelin classAbstractIOTask
-
-