eas之删除类别时刷新当前结点的父结点,并定位到当前结点的父结点。


KDTreeNode treeNode = (KDTreeNode) treeMain.getLastSelectedPathComponent();

if (treeNode != null && treeNode.getParent() != null)
{
TreePath parentPath = treeMain.getSelectionPath().getParentPath();

KDTreeNode parentNode = (KDTreeNode) treeNode.getParent();

parentNode.remove(treeNode);

treeMain.updateUI();

treeMain.setSelectionPath(parentPath);

treeBuilder.refreshTreeNode(treeMain , parentNode ,this.getDefaultFilterForTree());

treeMain.expandPath(parentPath);

}

posted @ 2019-06-26 08:07  一条有梦想的海洋咸鱼  阅读(173)  评论(0编辑  收藏  举报