use of eu.esdihumboldt.hale.ui.service.entity.util.EntityTypePropertyContentProvider in project hale by halestudio.
the class PropertyEntityDialog method setupViewer.
/**
* @see EntityDialog#setupViewer(TreeViewer, EntityDefinition)
*/
@Override
protected void setupViewer(TreeViewer viewer, EntityDefinition initialSelection) {
viewer.setLabelProvider(new StyledDefinitionLabelProvider(viewer));
EntityDefinitionService entityDefinitionService = PlatformUI.getWorkbench().getService(EntityDefinitionService.class);
if (parentType != null) {
viewer.setContentProvider(new TreePathProviderAdapter(new EntityTypePropertyContentProvider(entityDefinitionService, ssid)));
viewer.setInput(parentType);
} else {
flatRelevantProvider = new TreePathProviderAdapter(new EntityTypeIndexContentProvider(entityDefinitionService, ssid, true, false));
hierarchicalRelevantProvider = new TreePathProviderAdapter(new EntityTypeIndexHierarchy(entityDefinitionService, ssid, true, false));
flatAllProvider = new TreePathProviderAdapter(new EntityTypeIndexContentProvider(entityDefinitionService, ssid, false, false));
hierarchicalAllProvider = new TreePathProviderAdapter(new EntityTypeIndexHierarchy(entityDefinitionService, ssid, false, false));
viewer.setContentProvider(flatRelevantProvider);
SchemaService ss = PlatformUI.getWorkbench().getService(SchemaService.class);
viewer.setInput(ss.getSchemas(ssid));
}
if (initialSelection != null) {
viewer.setSelection(new StructuredSelection(initialSelection));
}
}
Aggregations