use of org.whole.lang.commons.model.VarType in project whole by wholeplatform.
the class CommonsContentAssistVisitor method visit.
public void visit(VarType entity) {
try {
IEntity variableEntity = entity.wGetParent();
IEntity variableEntityParent = variableEntity.wGetParent();
Set<EntityDescriptor<?>> assignableSet = getAllAssignableTo(variableEntityParent.wGetEntityDescriptor(variableEntity));
assignableSet.remove(entity.getValue());
List<VarType> assignableEntities = new ArrayList<VarType>(assignableSet.size());
for (EntityDescriptor<?> ed : assignableSet) assignableEntities.add(CommonsEntityFactory.instance.createVarType(ed));
Collections.sort(assignableEntities, new Comparator<VarType>() {
public int compare(VarType e1, VarType e2) {
return CommonsDataTypePresentationParser.unparseEntityDescriptor(e1.getValue()).compareToIgnoreCase(CommonsDataTypePresentationParser.unparseEntityDescriptor(e2.getValue()));
}
});
getOperation().setResult(assignableEntities.toArray(new IEntity[0]));
} catch (Exception e) {
// do nothing on error
}
}
Aggregations