use of eu.esdihumboldt.hale.ui.service.project.ProjectService in project hale by halestudio.
the class UserFallbackEntityResolver method getCache.
/**
* @return the current resolve cache
*/
public static ResolveCache getCache() {
ProjectService ps = HaleUI.getServiceProvider().getService(ProjectService.class);
ResolveCache result = ps.getTemporaryProperty(PROPERTY_RESOLVE_CACHE, Value.NULL).as(ResolveCache.class);
if (result == null) {
result = new ResolveCache();
ps.setTemporaryProperty(PROPERTY_RESOLVE_CACHE, Value.of(result));
}
return result;
}
use of eu.esdihumboldt.hale.ui.service.project.ProjectService in project hale by halestudio.
the class InstanceServiceSource method getCurrentState.
/**
* @see ISourceProvider#getCurrentState()
*/
@Override
public Map<String, Object> getCurrentState() {
InstanceService is = PlatformUI.getWorkbench().getService(InstanceService.class);
ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class);
Map<String, Object> result = new HashMap<String, Object>();
result.put(HAS_TRANSFORMED_INSTANCES, hasTransformedInstances(is));
result.put(HAS_SOURCE_INSTANCES, hasSourceInstances(is));
result.put(HAS_SOURCE_RESOURCES, hasSourceResources(ps));
return result;
}
use of eu.esdihumboldt.hale.ui.service.project.ProjectService in project hale by halestudio.
the class InstanceServiceSource method dispose.
/**
* @see ISourceProvider#dispose()
*/
@Override
public void dispose() {
InstanceService is = PlatformUI.getWorkbench().getService(InstanceService.class);
is.removeListener(instanceListener);
ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class);
ps.removeListener(projectServiceListener);
}
use of eu.esdihumboldt.hale.ui.service.project.ProjectService in project hale by halestudio.
the class InstanceSamplingToggleState method dispose.
@Override
public void dispose() {
ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class);
ps.removeListener(projectListener);
}
use of eu.esdihumboldt.hale.ui.service.project.ProjectService in project hale by halestudio.
the class InstanceViewPreferencePage method performOk.
@Override
public boolean performOk() {
ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class);
if (changed) {
if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Reload source data", "Applying the new settings will result in the source data being reloaded.")) {
return false;
}
// save the enabled state
ps.getConfigurationService().setBoolean(InstanceViewPreferences.KEY_ENABLED, enabled.getSelection());
// store the current editor value in the map
if (currentEditor != null) {
// store value for current sampler
Value setting = currentEditor.getValue();
samplerSettings.put(InstanceViewPreferences.SAMPLERS.inverse().get(currentSampler), setting);
}
// store the map in the configuration
for (Entry<String, Value> entry : samplerSettings.entrySet()) {
ps.getConfigurationService().setProperty(InstanceViewPreferences.KEY_SETTINGS_PREFIX + entry.getKey(), entry.getValue());
}
// store the selected sampler
Sampler selectedSampler = null;
if (!samplers.getSelection().isEmpty()) {
selectedSampler = (Sampler) ((IStructuredSelection) samplers.getSelection()).getFirstElement();
}
if (selectedSampler != null) {
ps.getConfigurationService().set(InstanceViewPreferences.KEY_SAMPLER, InstanceViewPreferences.SAMPLERS.inverse().get(selectedSampler));
}
// reload the data
ps.reloadSourceData();
changed = false;
}
if (ov_changed) {
ps.getConfigurationService().setBoolean(InstanceViewPreferences.KEY_OCCURRING_VALUES_USE_EXTERNAL, occurringValuesComplete.getSelection());
ov_changed = false;
}
return true;
}
Aggregations