org.openstreetmap.josm.gui.io
Class SaveLayerTask

java.lang.Object
  extended by org.openstreetmap.josm.gui.io.AbstractIOTask
      extended by org.openstreetmap.josm.gui.io.SaveLayerTask
All Implemented Interfaces:
java.lang.Runnable

 class SaveLayerTask
extends AbstractIOTask

SaveLayerTask saves the data managed by an OsmDataLayer to the OsmDataLayer#getAssociatedFile().

     ExecutorService executorService = ...
     SaveLayerTask task = new SaveLayerTask(layer, monitor);
     Future taskFuture = executorServce.submit(task)
     try {
        // wait for the task to complete
        taskFuture.get();
     } catch(Exception e) {
        e.printStackTracek();
     }
 


Field Summary
private  SaveLayerInfo layerInfo
           
private  ProgressMonitor parentMonitor
           
 
Constructor Summary
protected SaveLayerTask(SaveLayerInfo layerInfo, ProgressMonitor monitor)
           
 
Method Summary
 void cancel()
          Cancel the task
 void run()
          Runs the task
 
Methods inherited from class org.openstreetmap.josm.gui.io.AbstractIOTask
getLastException, isCanceled, isFailed, isSuccessful, setCanceled, setFailed, setLastException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

layerInfo

private SaveLayerInfo layerInfo

parentMonitor

private 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 to NullProgressMonitor.INSTANCE if null
Throws:
java.lang.IllegalArgumentException - thrown if layer is null
Method Detail

run

public void run()
Description copied from class: AbstractIOTask
Runs the task

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class AbstractIOTask

cancel

public void cancel()
Description copied from class: AbstractIOTask
Cancel the task

Specified by:
cancel in class AbstractIOTask


JOSM