use of eu.esdihumboldt.hale.common.align.extension.function.TypeParameterDefinition in project hale by halestudio.
the class FunctionGraphContentProvider method getElements.
/**
* @see ArrayContentProvider#getElements(Object)
*/
@Override
public Object[] getElements(Object inputElement) {
Collection<Object> collection = new ArrayList<Object>();
if (inputElement instanceof FunctionDefinition<?>) {
FunctionDefinition<?> function = (FunctionDefinition<?>) inputElement;
collection.add(function);
if (inputElement instanceof TypeFunctionDefinition) {
for (TypeParameterDefinition type : ((TypeFunctionDefinition) function).getSource()) {
collection.add(new Pair<Object, Object>(type, function));
}
for (TypeParameterDefinition type : ((TypeFunctionDefinition) function).getTarget()) {
collection.add(type);
}
}
if (inputElement instanceof PropertyFunctionDefinition) {
for (PropertyParameterDefinition prop : ((PropertyFunctionDefinition) function).getSource()) {
collection.add(new Pair<Object, Object>(prop, function));
}
for (PropertyParameterDefinition prop : ((PropertyFunctionDefinition) function).getTarget()) {
collection.add(prop);
}
}
return collection.toArray();
}
return super.getElements(inputElement);
}
Aggregations