use of org.absmodels.abs.plugin.builder.AbsNature in project abstools by abstools.
the class ABSContentOutlineProvider method getParent.
@Override
public Object getParent(Object element) {
if (element instanceof InternalASTNode<?>) {
InternalASTNode<?> node = (InternalASTNode<?>) element;
AbsNature nature = node.getNature();
ASTNode<?> parent = node.getASTNode().getParent();
assert nature != null;
/* Root nodes don't have parents, so there's nothing to wrap (ABSTools #301) */
if (parent == null) {
assert node.getASTNode() instanceof Model : element;
return null;
}
return new InternalASTNode<ASTNode<?>>(parent, nature);
}
return null;
}
use of org.absmodels.abs.plugin.builder.AbsNature in project abstools by abstools.
the class ABSContentOutlineProvider method getChildrenOf.
private Object[] getChildrenOf(IProject project) {
if (project.isOpen()) {
AbsNature nature = UtilityFunctions.getAbsNature(project);
java.util.List<Object> children = new ArrayList<Object>();
children.add(nature.getPackages());
children.addAll(Arrays.asList(baseProvider.getChildren(project)));
return children.toArray();
}
return EMPTY_OBJECT_ARRAY;
}
Aggregations