Search in sources :

Example 1 with EntityTypeIndexHierarchy

use of eu.esdihumboldt.hale.ui.service.entity.util.EntityTypeIndexHierarchy in project hale by halestudio.

the class EntitySchemaExplorer method createContentProvider.

/**
 * @see SchemaExplorer#createContentProvider(TreeViewer)
 */
@Override
protected IContentProvider createContentProvider(TreeViewer tree) {
    EntityDefinitionService service = PlatformUI.getWorkbench().getService(EntityDefinitionService.class);
    hierarchyProvider = new TreePathProviderAdapter(new EntityTypeIndexHierarchy(service, getSchemaSpace()));
    listProvider = new TreePathProviderAdapter(new EntityTypeIndexContentProvider(service, getSchemaSpace()));
    return listProvider;
}
Also used : EntityTypeIndexHierarchy(eu.esdihumboldt.hale.ui.service.entity.util.EntityTypeIndexHierarchy) EntityTypeIndexContentProvider(eu.esdihumboldt.hale.ui.service.entity.util.EntityTypeIndexContentProvider) TreePathProviderAdapter(eu.esdihumboldt.hale.ui.util.viewer.tree.TreePathProviderAdapter) EntityDefinitionService(eu.esdihumboldt.hale.ui.service.entity.EntityDefinitionService)

Example 2 with EntityTypeIndexHierarchy

use of eu.esdihumboldt.hale.ui.service.entity.util.EntityTypeIndexHierarchy 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)

Example 3 with EntityTypeIndexHierarchy

use of eu.esdihumboldt.hale.ui.service.entity.util.EntityTypeIndexHierarchy in project hale by halestudio.

the class TypeEntityDialog 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);
    flatRelevantProvider = new TreePathProviderAdapter(new EntityTypeIndexContentProvider(entityDefinitionService, ssid, true, true));
    if (!onlyMappingRelevant) {
        hierarchicalRelevantProvider = new TreePathProviderAdapter(new EntityTypeIndexHierarchy(entityDefinitionService, ssid, true, true));
        flatAllProvider = new TreePathProviderAdapter(new EntityTypeIndexContentProvider(entityDefinitionService, ssid, false, true));
        hierarchicalAllProvider = new TreePathProviderAdapter(new EntityTypeIndexHierarchy(entityDefinitionService, ssid, false, true));
        viewer.setContentProvider(flatAllProvider);
    } else {
        viewer.setContentProvider(flatRelevantProvider);
    }
    SchemaService ss = PlatformUI.getWorkbench().getService(SchemaService.class);
    viewer.setInput(ss.getSchemas(ssid));
    if (initialSelection instanceof TypeEntityDefinition) {
        viewer.setSelection(new StructuredSelection(initialSelection));
    }
}
Also used : TypeEntityDefinition(eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition) 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) TreePathProviderAdapter(eu.esdihumboldt.hale.ui.util.viewer.tree.TreePathProviderAdapter) EntityDefinitionService(eu.esdihumboldt.hale.ui.service.entity.EntityDefinitionService)

Aggregations

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