public boolean isLeaf(Object o) { if (o instanceof TreeTableNode) { TreeTableNode node = (TreeTableNode) o; return node.isLeaf(); } return getChildCount(o) == 0; }
/** Refresh the expansion (recursive function) */ public void expandRefresh(TreeTableNode moved) { if (moved instanceof TaskNode) { Task movedTask = (Task) moved.getUserObject(); if (movedTask.getExpand()) { getTreeTable().getTree().expandPath(TreeUtil.createPath(moved)); } for (int i = 0; i < moved.getChildCount(); i++) { expandRefresh(moved.getChildAt(i)); } } }
/* (non-Javadoc) * @see org.jdesktop.swingx.treetable.DefaultTreeTableModel#setValueAt(java.lang.Object, java.lang.Object, int) */ @Override public void setValueAt(Object value, Object node, int column) { if (node != null && node instanceof DBObjectTreeTableNode) { DBObjectTreeTableNode userNode = (DBObjectTreeTableNode) node; TreeTableNode parent = userNode.getParent(); while (parent.getParent() != root) { parent = parent.getParent(); } userNode = (UserTreeTableNode) parent; String userId = (String) userNode.getKey(); userNodeSet.put(userId, userNode); } super.setValueAt(value, node, column); }