if (!society.isEditable()) { int result = JOptionPane.showConfirmDialog(this, "Society has been or is being used; delete anyway?", "Society Not Editable", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (result != JOptionPane.YES_OPTION) return; }
  protected void deleteSocietyInNode(DefaultMutableTreeNode societyNode) {    SocietyComponent society = (SocietyComponent)societyNode.getUserObject();    if (!society.isEditable()) {      int result = JOptionPane.showConfirmDialog(this,						 "Society has been or is being used; delete anyway?",						 "Society Not Editable",						 JOptionPane.YES_NO_OPTION,						 JOptionPane.WARNING_MESSAGE);      if (result != JOptionPane.YES_OPTION)	return;    }    model.removeNodeFromParent(societyNode);    // if deleted last reference to society in the workspace    // ask if society should be deleted from database and delete it    if (findNodeNamed(society.getSocietyName()) != null)        return;    //    removeSocietyFromList(society);    int answer =      JOptionPane.showConfirmDialog(this,                                    "Delete society " +                                    society.getSocietyName() +                                    " from database?",                                    "Delete Society",                                    JOptionPane.YES_NO_OPTION);    if (answer == JOptionPane.YES_OPTION) {      try {	// Will only actually do the delete	// if no-one uses it	PopulateDb.deleteSociety(society.getAssemblyId());      } catch (Exception e) {	if (log.isErrorEnabled()) {	  log.error("Exception deleting society " + society.getSocietyName() + " from db", e);	}      }    }  }