/** * Control whether the child elements of the specified node are visible. * * @param expanded <code>true</code> to expand the node, <code>false</code> * to collapse it. */ public void setExpanded(int visibleIndex, boolean expanded) { Node<E> toExpand = data.get(visibleIndex, VISIBLE_NODES).get(); expansionModel.setExpanded(toExpand.getElement(), toExpand.path, expanded); setExpanded(toExpand, expanded); assert(isValid()); }
/** * Control whether the child elements of the specified node are visible. * * @param expanded <code>true</code> to expand the node, <code>false</code> * to collapse it. */ public void setExpanded(int visibleIndex, boolean expanded) { Node<E> toExpand = data.get(visibleIndex, VISIBLE_NODES).get(); expansionModel.setExpanded(toExpand.getElement(), toExpand.path, expanded); setExpanded(toExpand, expanded); assert(isValid()); }
/** * Control whether the child elements of the specified node are visible. * * @param expanded <code>true</code> to expand the node, <code>false</code> * to collapse it. */ public void setExpanded(int visibleIndex, boolean expanded) { Node<E> toExpand = data.get(visibleIndex, VISIBLE_NODES).get(); expansionModel.setExpanded(toExpand.getElement(), toExpand.path, expanded); setExpanded(toExpand, expanded); assert(isValid()); }
/** master Constructor */ private TreeList(InitializationData<E> initializationData) { super(initializationData.getSource()); this.format = initializationData.format; this.nodeComparator = initializationData.nodeComparator; this.expansionModel = initializationData.expansionModel; this.initializationData = initializationData; // insert the new elements like they were adds NodeAttacher nodeAttacher = new NodeAttacher(false); for(int i = 0; i < super.source.size(); i++) { Node<E> node = super.source.get(i); node.expanded = expansionModel.isExpanded(node.getElement(), node.path); addNode(node, HIDDEN_REAL, i); nodeAttacher.nodesToAttach.queueNewNodeForInserting(node); } // attach siblings and parent nodes nodeAttacher.attachAll(); assert(isValid()); source.addListEventListener(this); }
/** master Constructor */ private TreeList(InitializationData<E> initializationData) { super(initializationData.getSource()); this.format = initializationData.format; this.nodeComparator = initializationData.nodeComparator; this.expansionModel = initializationData.expansionModel; this.initializationData = initializationData; // insert the new elements like they were adds NodeAttacher nodeAttacher = new NodeAttacher(false); for(int i = 0; i < super.source.size(); i++) { Node<E> node = super.source.get(i); node.expanded = expansionModel.isExpanded(node.getElement(), node.path); addNode(node, HIDDEN_REAL, i); nodeAttacher.nodesToAttach.queueNewNodeForInserting(node); } // attach siblings and parent nodes nodeAttacher.attachAll(); assert(isValid()); source.addListEventListener(this); }
/** master Constructor */ private TreeList(InitializationData<E> initializationData) { super(initializationData.getSource()); this.format = initializationData.format; this.nodeComparator = initializationData.nodeComparator; this.expansionModel = initializationData.expansionModel; this.initializationData = initializationData; // insert the new elements like they were adds NodeAttacher nodeAttacher = new NodeAttacher(false); for(int i = 0; i < super.source.size(); i++) { Node<E> node = super.source.get(i); node.expanded = expansionModel.isExpanded(node.getElement(), node.path); addNode(node, HIDDEN_REAL, i); nodeAttacher.nodesToAttach.queueNewNodeForInserting(node); } // attach siblings and parent nodes nodeAttacher.attachAll(); assert(isValid()); source.addListEventListener(this); }