userObject instanceof SocietyComponent) ((SocietyComponent)userObject).setEditable(true);
userObject instanceof ModifiableConfigurableComponent) ((ModifiableConfigurableComponent)userObject).setEditable(true);
  private void removeSelectedItems() {    TreePath[] selectionPaths = tree.getSelectionPaths();    if (selectionPaths == null)      return;    DefaultMutableTreeNode[] nodes =       new DefaultMutableTreeNode[selectionPaths.length];    for (int i = 0; i < nodes.length; i++) {      nodes[i] =	(DefaultMutableTreeNode) selectionPaths[i].getLastPathComponent();    }    for (int i = 0; i < nodes.length; i++) {      model.removeNodeFromParent(nodes[i]);      // make removed society component editable again      Object userObject = nodes[i].getUserObject();      if (userObject != null &&	  userObject instanceof SocietyComponent)	((SocietyComponent)userObject).setEditable(true);    }    propModel.clear(); // selected items were removed, so clear prop table  }