Search in sources :

Example 16 with Definition

use of eu.esdihumboldt.hale.common.schema.model.Definition in project hale by halestudio.

the class ClassificationFilter method select.

/**
 * @see ViewerFilter#select(Viewer, Object, Object)
 */
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
    if (element instanceof TreePath) {
        element = ((TreePath) element).getLastSegment();
    }
    if (element instanceof EntityDefinition) {
        element = ((EntityDefinition) element).getDefinition();
    }
    if (hidden.isEmpty() || !(element instanceof Definition<?>)) {
        // fast exit
        return true;
    }
    Definition<?> def = (Definition<?>) element;
    Classification clazz = Classification.getClassification(def);
    return !hidden.contains(clazz);
}
Also used : EntityDefinition(eu.esdihumboldt.hale.common.align.model.EntityDefinition) TreePath(org.eclipse.jface.viewers.TreePath) Classification(eu.esdihumboldt.hale.common.schema.Classification) EntityDefinition(eu.esdihumboldt.hale.common.align.model.EntityDefinition) Definition(eu.esdihumboldt.hale.common.schema.model.Definition)

Aggregations

Definition (eu.esdihumboldt.hale.common.schema.model.Definition)16 TypeDefinition (eu.esdihumboldt.hale.common.schema.model.TypeDefinition)10 ChildDefinition (eu.esdihumboldt.hale.common.schema.model.ChildDefinition)7 EntityDefinition (eu.esdihumboldt.hale.common.align.model.EntityDefinition)5 PropertyDefinition (eu.esdihumboldt.hale.common.schema.model.PropertyDefinition)4 QName (javax.xml.namespace.QName)4 DefinitionAccessor (eu.esdihumboldt.hale.common.schema.groovy.DefinitionAccessor)3 XmlElement (eu.esdihumboldt.hale.io.xsd.model.XmlElement)3 ChildContext (eu.esdihumboldt.hale.common.align.model.ChildContext)2 TypeEntityDefinition (eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition)2 InstanceValidationMessage (eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationMessage)2 InstanceValidationReport (eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationReport)2 DefinitionGroup (eu.esdihumboldt.hale.common.schema.model.DefinitionGroup)2 HasValueFlag (eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag)2 Pair (eu.esdihumboldt.util.Pair)2 List (java.util.List)2 GridData (org.eclipse.swt.layout.GridData)2 FunctionDefinition (eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition)1 ChildContextType (eu.esdihumboldt.hale.common.align.io.impl.internal.generated.ChildContextType)1 Cell (eu.esdihumboldt.hale.common.align.model.Cell)1