Search in sources :

Example 1 with InstanceValidationService

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

the class ToggleInstanceValidationHandler method updateElement.

@Override
public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
    InstanceValidationService ivs = PlatformUI.getWorkbench().getService(InstanceValidationService.class);
    element.setChecked(ivs.isValidationEnabled());
}
Also used : InstanceValidationService(eu.esdihumboldt.hale.ui.service.instance.validation.InstanceValidationService)

Example 2 with InstanceValidationService

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

the class ToggleInstanceValidationState method dispose.

@Override
public void dispose() {
    InstanceValidationService ivs = PlatformUI.getWorkbench().getService(InstanceValidationService.class);
    ivs.removeListener(listener);
    super.dispose();
}
Also used : InstanceValidationService(eu.esdihumboldt.hale.ui.service.instance.validation.InstanceValidationService)

Example 3 with InstanceValidationService

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

the class InstanceValidationStatusAction method createListeners.

/**
 * Registers needed listeners.
 */
private void createListeners() {
    InstanceService is = PlatformUI.getWorkbench().getService(InstanceService.class);
    is.addListener(new InstanceServiceAdapter() {

        @Override
        public void datasetAboutToChange(DataSet type) {
            report = null;
            PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {

                @Override
                public void run() {
                    updateStatus();
                }
            });
        }
    });
    final InstanceValidationService ivs = PlatformUI.getWorkbench().getService(InstanceValidationService.class);
    ivs.addListener(new InstanceValidationListener() {

        @Override
        public void instancesValidated(InstanceValidationReport report) {
            InstanceValidationStatusAction.this.report = report;
            PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {

                @Override
                public void run() {
                    updateStatus();
                }
            });
        }

        @Override
        public void validationEnabledChange() {
        // don't care
        }
    });
}
Also used : InstanceValidationReport(eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationReport) DataSet(eu.esdihumboldt.hale.common.instance.model.DataSet) InstanceService(eu.esdihumboldt.hale.ui.service.instance.InstanceService) InstanceServiceAdapter(eu.esdihumboldt.hale.ui.service.instance.InstanceServiceAdapter) InstanceValidationService(eu.esdihumboldt.hale.ui.service.instance.validation.InstanceValidationService) InstanceValidationListener(eu.esdihumboldt.hale.ui.service.instance.validation.InstanceValidationListener)

Example 4 with InstanceValidationService

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

the class ToggleInstanceValidationHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    InstanceValidationService ivs = PlatformUI.getWorkbench().getService(InstanceValidationService.class);
    ivs.setValidationEnabled(!ivs.isValidationEnabled());
    return null;
}
Also used : InstanceValidationService(eu.esdihumboldt.hale.ui.service.instance.validation.InstanceValidationService)

Aggregations

InstanceValidationService (eu.esdihumboldt.hale.ui.service.instance.validation.InstanceValidationService)4 InstanceValidationReport (eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationReport)1 DataSet (eu.esdihumboldt.hale.common.instance.model.DataSet)1 InstanceService (eu.esdihumboldt.hale.ui.service.instance.InstanceService)1 InstanceServiceAdapter (eu.esdihumboldt.hale.ui.service.instance.InstanceServiceAdapter)1 InstanceValidationListener (eu.esdihumboldt.hale.ui.service.instance.validation.InstanceValidationListener)1