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);
}
Aggregations