if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
LayerFactory factory = map.getLayerFactory();
if (factory == null) {
factory = ProjectFactory.eINSTANCE.createLayerFactory();
}
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
for( IGeoResource resource : geoResources ) {
monitor.beginTask(Messages.MapFactory_retrieveTask, geoResources.size());
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
try {
IService service = resource.service(monitor);
CatalogPlugin.getDefault().getLocalCatalog().add(service);
Layer layer = factory.createLayer(resource);
if (layer != null) {
layers.add(layer);
}
} catch (IOException e) {
exceptions.add(e);