/** * Add a node handler. */ public void addNodeHandler(ISwingNodeHandler handler) { model.addNodeHandler(handler); }
public Action getDefaultAction(final ISwingTreeNode node) { Action ret = null; if(node.hasProperties()) { ret = showprops; } return ret; } });
/** * Get the given child of a node. */ public ITreeNode getChild(Object parent, int index) { return ((ITreeNode) parent).getChild(index); }
public void customResultAvailable(Icon result) { model.fireNodeChanged(node); }
/** * Inform listeners that a node has been removed */ public void fireNodesRemoved(ITreeNode parent, ITreeNode[] childs, int[] indices) { List<ITreeNode> path = buildTreePath(parent); // System.err.println(""+hashCode()+" Node removed: "+child+", "+index+", "+path); for(int i = 0; i < listeners.size(); i++) { listeners.get(i).treeNodesRemoved(new AsyncTreeModelEvent(this, path.toArray(), indices, childs)); } }
/** * Inform listeners that tree has changed from given node on. */ public void fireTreeChanged(ITreeNode node) { List<ITreeNode> path = buildTreePath(node); // System.err.println(""+hashCode()+" Path changed: "+node+", "+path+", "+node.getCachedChildren()); for(int i = 0; i < listeners.size(); i++) { listeners.get(i).treeStructureChanged(new AsyncTreeModelEvent(this, path.toArray())); } }
/** * Test if the node is a leaf. */ public boolean isLeaf(Object node) { return ((ITreeNode) node).isLeaf(); }
/** * Get the model. */ @Override public AsyncSwingTreeModel getModel() { return (AsyncSwingTreeModel) super.getModel(); }
/** * Check if the node is a leaf. */ public boolean isLeaf() { return getChildCount() == 0; }
/** * Set the children. */ // Made public to support external refresh in deployer. public void setChildren(List newchildren) { this.children = newchildren; super.setChildren(newchildren); }
/** * Get the index of a child. */ public int getIndexOfChild(Object parent, Object child) { return ((ITreeNode) parent).getIndexOfChild((ITreeNode) child); }
/** * Get the number of children of a node. */ public int getChildCount(Object parent) { return ((ITreeNode) parent).getChildCount(); }
/** * Create a new service container node. */ public ServiceContainerNode(ISwingTreeNode parent, AsyncSwingTreeModel model, JTree tree, IServiceContainer container) { super(parent, model, tree); this.container = container; model.registerNode(this); }
@Override public ISwingTreeNode getNodeOrAddZombie(Object id) { return (ISwingTreeNode) super.getNodeOrAddZombie(id); }
/** * Get the parent node. */ @Override public ISwingTreeNode getParent() { return (ISwingTreeNode) super.getParent(); }
/** * Inform listeners that a node has been removed */ public void fireNodeRemoved(ITreeNode parent, ITreeNode child, int index) { List<ITreeNode> path = buildTreePath(parent); // System.err.println(""+hashCode()+" Node removed: "+child+", "+index+", "+path); for(int i = 0; i < listeners.size(); i++) { listeners.get(i).treeNodesRemoved( new AsyncTreeModelEvent(this, path.toArray(), new int[]{index}, new Object[]{child})); } }
/** * Set the children. */ protected void setChildren(List children) { this.broken = false; super.setChildren(children); }
/** * Add a node handler. */ public void addNodeHandler(ISwingNodeHandler handler) { model.addNodeHandler(handler); }
/** * Set the children. */ protected void setChildren(List<? extends ITreeNode> children) { super.setChildren(children); }