Search in sources :

Example 21 with InstanceService

use of eu.esdihumboldt.hale.ui.service.instance.InstanceService in project hale by halestudio.

the class ProjectServiceImpl method reloadSourceData.

@Override
public void reloadSourceData() {
    IRunnableWithProgress op = new IRunnableWithProgress() {

        @Override
        public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            monitor.beginTask("Reload source data", IProgressMonitor.UNKNOWN);
            monitor.subTask("Clear loaded instances");
            // drop the existing instances
            InstanceService is = PlatformUI.getWorkbench().getService(InstanceService.class);
            is.dropInstances();
            // reload the instances
            for (IOConfiguration conf : main.getResources()) {
                if (InstanceIO.ACTION_LOAD_SOURCE_DATA.equals(conf.getActionId())) {
                    executeConfiguration(conf);
                }
            }
            monitor.done();
        }
    };
    try {
        ThreadProgressMonitor.runWithProgressDialog(op, false);
    } catch (Exception e) {
        log.error("Executing data reload failed", e);
    }
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IOConfiguration(eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration) InstanceService(eu.esdihumboldt.hale.ui.service.instance.InstanceService) InvocationTargetException(java.lang.reflect.InvocationTargetException) ExecutionException(java.util.concurrent.ExecutionException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress)

Aggregations

InstanceService (eu.esdihumboldt.hale.ui.service.instance.InstanceService)21 Instance (eu.esdihumboldt.hale.common.instance.model.Instance)6 InstanceReference (eu.esdihumboldt.hale.common.instance.model.InstanceReference)5 GeometrySchemaService (eu.esdihumboldt.hale.ui.geometry.service.GeometrySchemaService)5 InstanceCollection (eu.esdihumboldt.hale.common.instance.model.InstanceCollection)4 DataSet (eu.esdihumboldt.hale.common.instance.model.DataSet)3 StyleService (eu.esdihumboldt.hale.ui.common.service.style.StyleService)3 ProjectService (eu.esdihumboldt.hale.ui.service.project.ProjectService)3 SchemaService (eu.esdihumboldt.hale.ui.service.schema.SchemaService)3 EntityDefinition (eu.esdihumboldt.hale.common.align.model.EntityDefinition)2 TypeDefinition (eu.esdihumboldt.hale.common.schema.model.TypeDefinition)2 InstanceServiceAdapter (eu.esdihumboldt.hale.ui.service.instance.InstanceServiceAdapter)2 ISelectionService (org.eclipse.ui.ISelectionService)2 MultiPoint (com.vividsolutions.jts.geom.MultiPoint)1 Point (com.vividsolutions.jts.geom.Point)1 ITileOverlayService (de.fhg.igd.mapviewer.view.overlay.ITileOverlayService)1 TileOverlayFactory (de.fhg.igd.mapviewer.view.overlay.TileOverlayFactory)1 SelectableWaypoint (de.fhg.igd.mapviewer.waypoints.SelectableWaypoint)1 PropertyParameter (eu.esdihumboldt.hale.common.align.extension.function.PropertyParameter)1 PropertyParameterDefinition (eu.esdihumboldt.hale.common.align.extension.function.PropertyParameterDefinition)1