Search in sources :

Example 1 with EntityTypePropertyContentProvider

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));
    }
}
Also used : StyledDefinitionLabelProvider(eu.esdihumboldt.hale.ui.common.definition.viewer.StyledDefinitionLabelProvider) EntityTypeIndexHierarchy(eu.esdihumboldt.hale.ui.service.entity.util.EntityTypeIndexHierarchy) SchemaService(eu.esdihumboldt.hale.ui.service.schema.SchemaService) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EntityTypeIndexContentProvider(eu.esdihumboldt.hale.ui.service.entity.util.EntityTypeIndexContentProvider) EntityTypePropertyContentProvider(eu.esdihumboldt.hale.ui.service.entity.util.EntityTypePropertyContentProvider) TreePathProviderAdapter(eu.esdihumboldt.hale.ui.util.viewer.tree.TreePathProviderAdapter) EntityDefinitionService(eu.esdihumboldt.hale.ui.service.entity.EntityDefinitionService)

Aggregations

StyledDefinitionLabelProvider (eu.esdihumboldt.hale.ui.common.definition.viewer.StyledDefinitionLabelProvider)1 EntityDefinitionService (eu.esdihumboldt.hale.ui.service.entity.EntityDefinitionService)1 EntityTypeIndexContentProvider (eu.esdihumboldt.hale.ui.service.entity.util.EntityTypeIndexContentProvider)1 EntityTypeIndexHierarchy (eu.esdihumboldt.hale.ui.service.entity.util.EntityTypeIndexHierarchy)1 EntityTypePropertyContentProvider (eu.esdihumboldt.hale.ui.service.entity.util.EntityTypePropertyContentProvider)1 SchemaService (eu.esdihumboldt.hale.ui.service.schema.SchemaService)1 TreePathProviderAdapter (eu.esdihumboldt.hale.ui.util.viewer.tree.TreePathProviderAdapter)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1