if (!cc.isEditable()) { Object[] options = { "Edit", "View", "Copy", "Cancel" }; int result = JOptionPane.showOptionDialog(this, cc.getShortName() + " is not editable", "Not Editable", JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); if (result == 0) {  cc.setEditable(true); } else if (result == 2) {  if (cc instanceof RecipeComponent) cc = organizer.copyRecipe((RecipeComponent)cc); else if (cc instanceof SocietyComponent) cc = organizer.copySociety((SocietyComponent)cc); } else if (result != 1)  return; }
  public void runBuilder(ModifiableComponent cc,                          boolean alwaysNew) {    if (!cc.isEditable()) {      Object[] options = { "Edit", "View", "Copy", "Cancel" };      int result =         JOptionPane.showOptionDialog(this,                                     cc.getShortName() + " is not editable",                                     "Not Editable",                                     JOptionPane.DEFAULT_OPTION,                                     JOptionPane.WARNING_MESSAGE,                                     null,                                     options,                                     options[0]);      if (result == 0) {        // edit it anyway        cc.setEditable(true);      } else if (result == 2) {        // copy it        if (cc instanceof RecipeComponent)          cc = organizer.copyRecipe((RecipeComponent)cc);        else if (cc instanceof SocietyComponent)          cc = organizer.copySociety((SocietyComponent)cc);      } else if (result != 1)        // user cancelled        return;    }    // note that cc is guaranteed non-null when this is called    Class[] paramClasses = { ModifiableComponent.class };    Object[] params = new Object[1];    params[0] = cc;    createTool(CONFIGURATION_BUILDER, PropertyBuilder.class, 	       alwaysNew, cc.getShortName(), (ModifiableComponent)cc,	       paramClasses, params);  }