1 package com.quantum.view.bookmark;
3 import java.beans.PropertyChangeEvent;
4 import java.beans.PropertyChangeListener;
6 import com.quantum.Messages;
11 public class QueryListNode extends TreeNode implements PropertyChangeListener {
16 public QueryListNode(TreeNode parent) {
18 getBookmark().addPropertyChangeListener(this);
22 * @see com.quantum.view.bookmark.TreeNode#getChildren()
24 public Object[] getChildren() {
26 return (TreeNode[]) this.children.toArray(new TreeNode[this.children.size()]);
29 protected void initializeChildren() {
30 this.children.clear();
31 String[] queries = getBookmark().getQueries();
32 for (int i = 0, length = (queries == null) ? 0 : queries.length;
35 this.children.add(new QueryNode(this, queries[i]));
40 * @see com.quantum.view.bookmark.TreeNode#hasChildren()
42 public boolean hasChildren() {
43 return getBookmark().getQueries().length > 0;
47 * @see com.quantum.view.bookmark.TreeNode#getName()
49 public String getName() {
50 return Messages.getString(getClass().getName() + ".labelName");
54 * @see com.quantum.view.bookmark.TreeNode#getImageName()
56 protected String getImageName() {
61 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
63 public void propertyChange(PropertyChangeEvent event) {
64 if ("queries".equals(event.getPropertyName())) {
65 firePropertyChange("queries", null, null);
69 * @see com.quantum.view.bookmark.TreeNode#dispose()
71 protected void dispose() {
72 getBookmark().removePropertyChangeListener(this);