Пример #1
0
  private void clearConfigForSelectedCharacters() {
    int confirmation =
        JOptionPane.showConfirmDialog(
            panel,
            "WARNING:  this will erase the current configuration for all selected characters. \nAre you certain you wish to do this?",
            "Clear Selected Configurations?",
            JOptionPane.YES_NO_OPTION);

    if (confirmation == JOptionPane.YES_OPTION) {
      for (Object character : herolabsCharacterList.getSelectedValues()) {
        config.remove(((Character) character).getName());
      }
    }

    herolabsCharacterList.repaint();
  }
Пример #2
0
  private void resetToDefaultsForSelectedCharacters() {
    int confirmation =
        JOptionPane.showConfirmDialog(
            panel,
            "NOTE:  this will attempt to replace any custom configuration for the selected characters with the Portfolio defaults. \nAre you certain you wish to do this?",
            "Reset to portfolio defaults?",
            JOptionPane.YES_NO_OPTION);

    if (confirmation == JOptionPane.YES_OPTION) {
      for (Object character : herolabsCharacterList.getSelectedValues()) {
        config.populateCharacterWithDefaults(((Character) character).getName(), true);
      }
    }

    herolabsCharacterList.repaint();
  }