/** * {@inheritDoc} */ public void insert(MutableTreeTableNode child, int index) { if (!allowsChildren) { throw new IllegalStateException("this node cannot accept children"); } if (children.contains(child)) { children.remove(child); index--; } children.add(index, child); if (child.getParent() != this) { child.setParent(this); } }
/** * {@inheritDoc} */ @Override public void insert(MutableTreeTableNode child, int index) { if (!allowsChildren) { throw new IllegalStateException("this node cannot accept children"); } if (children.contains(child)) { children.remove(child); index--; } children.add(index, child); if (child.getParent() != this) { child.setParent(this); } }
/** * {@inheritDoc} */ @Override public void insert(MutableTreeTableNode child, int index) { if (!allowsChildren) { throw new IllegalStateException("this node cannot accept children"); } if (children.contains(child)) { children.remove(child); index--; } children.add(index, child); if (child.getParent() != this) { child.setParent(this); } }
/** * {@inheritDoc} */ @Override public void insert(MutableTreeTableNode child, int index) { if (!allowsChildren) { throw new IllegalStateException("this node cannot accept children"); } if (children.contains(child)) { children.remove(child); index--; } children.add(index, child); if (child.getParent() != this) { child.setParent(this); } }
/** * {@inheritDoc} */ @Override public void insert(MutableTreeTableNode child, int index) { if (!allowsChildren) { throw new IllegalStateException("this node cannot accept children"); } if (children.contains(child)) { children.remove(child); index--; } children.add(index, child); if (child.getParent() != this) { child.setParent(this); } }
/** * Message this to remove node from its parent. This will message * nodesWereRemoved to create the appropriate event. This is the preferred * way to remove a node as it handles the event creation for you. */ public void removeNodeFromParent(MutableTreeTableNode node) { MutableTreeTableNode parent = (MutableTreeTableNode) node.getParent(); if (parent == null) { throw new IllegalArgumentException("node does not have a parent."); } int index = parent.getIndex(node); node.removeFromParent(); modelSupport.fireChildRemoved(new TreePath(getPathToRoot(parent)), index, node); }
/** * Message this to remove node from its parent. This will message * nodesWereRemoved to create the appropriate event. This is the preferred * way to remove a node as it handles the event creation for you. */ public void removeNodeFromParent(MutableTreeTableNode node) { MutableTreeTableNode parent = (MutableTreeTableNode) node.getParent(); if (parent == null) { throw new IllegalArgumentException("node does not have a parent."); } int index = parent.getIndex(node); node.removeFromParent(); modelSupport.fireChildRemoved(new TreePath(getPathToRoot(parent)), index, node); }
/** * Message this to remove node from its parent. This will message * nodesWereRemoved to create the appropriate event. This is the preferred * way to remove a node as it handles the event creation for you. */ public void removeNodeFromParent(MutableTreeTableNode node) { MutableTreeTableNode parent = (MutableTreeTableNode) node.getParent(); if (parent == null) { throw new IllegalArgumentException("node does not have a parent."); } int index = parent.getIndex(node); node.removeFromParent(); modelSupport.fireChildRemoved(new TreePath(getPathToRoot(parent)), index, node); }
/** * Message this to remove node from its parent. This will message * nodesWereRemoved to create the appropriate event. This is the preferred * way to remove a node as it handles the event creation for you. */ public void removeNodeFromParent(MutableTreeTableNode node) { MutableTreeTableNode parent = (MutableTreeTableNode) node.getParent(); if (parent == null) { throw new IllegalArgumentException("node does not have a parent."); } int index = parent.getIndex(node); node.removeFromParent(); modelSupport.fireChildRemoved(new TreePath(getPathToRoot(parent)), index, node); }
/** * Message this to remove node from its parent. This will message * nodesWereRemoved to create the appropriate event. This is the preferred * way to remove a node as it handles the event creation for you. */ public void removeNodeFromParent(MutableTreeTableNode node) { MutableTreeTableNode parent = (MutableTreeTableNode) node.getParent(); if (parent == null) { throw new IllegalArgumentException("node does not have a parent."); } int index = parent.getIndex(node); node.removeFromParent(); modelSupport.fireChildRemoved(new TreePath(getPathToRoot(parent)), index, node); }