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()
Runs the task
|
getLastException, isCanceled, isFailed, isSuccessful, setCanceled, setFailed, setLastException
private SaveLayerInfo layerInfo
private 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()
AbstractIOTask
run
in interface java.lang.Runnable
run
in class AbstractIOTask
public void cancel()
AbstractIOTask
cancel
in class AbstractIOTask