public static void removeNode(ReportTreeNode node) { TestElement testElement = node.getTestElement(); if (testElement.canRemove()) { ReportGuiPackage.getInstance().getTreeModel().removeNodeFromParent(node); ReportGuiPackage.getInstance().removeNode(testElement); } else { String message = testElement.getClass().getName() + " is busy"; JOptionPane.showMessageDialog(null, message, "Cannot remove item", JOptionPane.ERROR_MESSAGE); } }