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
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();
}
Method Summary |
void |
cancel()
Cancel the task |
void |
run()
Runs the task |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
layerInfo
private SaveLayerInfo layerInfo
parentMonitor
private ProgressMonitor parentMonitor
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
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