X-Git-Url: http://git.phpeclipse.com diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/bookmark/TreeNode.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/bookmark/TreeNode.java index 1d18d38..e4130b0 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/bookmark/TreeNode.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/bookmark/TreeNode.java @@ -1,12 +1,14 @@ package com.quantum.view.bookmark; import java.beans.PropertyChangeEvent; +import java.sql.SQLException; import java.util.Iterator; import java.util.Vector; -import com.quantum.QuantumPlugin; +import com.quantum.ImageStore; import com.quantum.model.Bookmark; import com.quantum.model.BookmarkHolder; +import com.quantum.model.NotConnectedException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.swt.graphics.Image; @@ -26,7 +28,7 @@ public abstract class TreeNode this.parent = parent; } - public abstract Object[] getChildren(); + public abstract Object[] getChildren() throws NotConnectedException, SQLException; public TreeNode getParent() { return this.parent; } @@ -34,7 +36,7 @@ public abstract class TreeNode public abstract String getName(); public Bookmark getBookmark() { - return getParent().getBookmark(); + return getParent() == null ? null : getParent().getBookmark(); } public String getLabelName() { @@ -45,7 +47,7 @@ public abstract class TreeNode * @return an Image object to appear in the view, null if not found */ public Image getImage() { - return QuantumPlugin.getImage(getImageName()); + return ImageStore.getImage(getImageName()); } /** @@ -59,7 +61,7 @@ public abstract class TreeNode */ public int compareTo(Object object) { TreeNode that = (TreeNode) object; - return this.getLabelName().compareTo(that.getLabelName()); + return this.getLabelName().toLowerCase().compareTo(that.getLabelName().toLowerCase()); } public String toString() { @@ -97,6 +99,7 @@ public abstract class TreeNode protected void dispose() { this.disposed = true; removeAllChildren(); +// this.parent = null; } protected void removeAllChildren() { for (Iterator i = this.children.iterator(); i.hasNext();) { @@ -112,8 +115,9 @@ public abstract class TreeNode public Object getAdapter(Class adapter) { return null; } - protected abstract void initializeChildren(); - public void reload() { + protected abstract void initializeChildren() throws SQLException, NotConnectedException; + + public void reload() throws NotConnectedException, SQLException { if (isInitialized()) { initializeChildren(); for (Iterator i = this.children.iterator(); i.hasNext(); ) {