1 package net.sourceforge.phpdt.sql.view.bookmark;
3 import java.util.Collections;
4 import java.util.Vector;
6 import net.sourceforge.phpdt.sql.bookmarks.Bookmark;
8 public class BookmarkNode extends Bookmark implements TreeNode {
9 private Vector children = new Vector();
11 public BookmarkNode() {
14 public BookmarkNode(Bookmark bookmark) {
18 public Object[] getChildren() {
19 return children.toArray();
22 public Object getParent() {
26 public boolean hasChildren() {
27 if (children != null && children.size() > 0) {
33 public void setChildren(Vector children) {
34 for (int i = 0; i < children.size(); i++) {
35 Object obj = children.elementAt(i);
38 Collections.sort(children);
39 this.children = children;
42 public void isValid(Object child) {
43 boolean valid = false;
44 if (child instanceof TableNode ||
45 child instanceof ViewNode ||
46 child instanceof SequenceNode) {
50 throw new RuntimeException("Invalid BookmarkNode child: " + child.getClass().getName());