public Object getChild(Object parent, int index) {
        if (parent instanceof Page) {
            Page p = (Page)parent;
            if (index >= p.children.size()) {
                int j = index - p.children.size();
                return p.names.get(j);
            } else {
                return p.children.get(index);
            }
        } else {
            return null;
        }
    }