public class SaveLayerTask extends AbstractIOTask
AbstractModifiableLayer
to the
Layer.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(); }
Modifier and Type | Field and Description |
---|---|
private SaveLayerInfo |
layerInfo |
private ProgressMonitor |
parentMonitor |
Modifier | Constructor and Description |
---|---|
protected |
SaveLayerTask(SaveLayerInfo layerInfo,
ProgressMonitor monitor) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel the task
|
void |
run() |
getLastException, isCanceled, isFailed, isSuccessful, setCanceled, setFailed, setLastException
private final SaveLayerInfo layerInfo
private final ProgressMonitor parentMonitor
protected SaveLayerTask(SaveLayerInfo layerInfo, ProgressMonitor monitor)
layerInfo
- information about the layer to be saved to save. Must not be null.monitor
- the monitor. Set to NullProgressMonitor.INSTANCE
if nulljava.lang.IllegalArgumentException
- if layer is nullpublic void run()
public void cancel()
AbstractIOTask
cancel
in class AbstractIOTask