public class SaveLayerTask extends AbstractIOTask
AbstractModifiableLayer to the
Layer.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();
}
| 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, setLastExceptionprivate 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 - thrown if layer is nullpublic void run()
AbstractIOTaskrun in interface java.lang.Runnablerun in class AbstractIOTaskpublic void cancel()
AbstractIOTaskcancel in class AbstractIOTask