userObject instanceof SocietyComponent) ((SocietyComponent)userObject).setEditable(true);
userObject instanceof ModifiableConfigurableComponent) ((ModifiableConfigurableComponent)userObject).setEditable(true);
  private void removeAllChildren(DefaultMutableTreeNode parent) {    for (int i = 0; i < parent.getChildCount(); i++) {      DefaultMutableTreeNode node = 	(DefaultMutableTreeNode)parent.getChildAt(i);      // make removed society component editable again      Object userObject = node.getUserObject();      if (userObject != null &&	  userObject instanceof SocietyComponent)	((SocietyComponent)userObject).setEditable(true);    }    parent.removeAllChildren();    model.nodeStructureChanged(parent);  }