コード例 #1
0
 public boolean isModified(ApplicationSettings settings) {
   updateCurrentRule();
   List<LibraryBundlificationRule> rules = settings.getLibraryBundlificationRules();
   if (myRulesModel.getSize() != rules.size()) {
     return true;
   }
   for (int i = 0; i < rules.size(); i++) {
     if (!rules.get(i).equals(myRulesModel.getElementAt(i))) {
       return true;
     }
   }
   return false;
 }
コード例 #2
0
  public void applyTo(ApplicationSettings settings) throws ConfigurationException {
    updateCurrentRule();

    for (int i = 0; i < myRulesModel.getSize(); i++) {
      try {
        myRulesModel.getElementAt(i).validate();
      } catch (IllegalArgumentException e) {
        myRulesList.setSelectedIndex(i);
        throw new ConfigurationException(e.getMessage());
      }
    }

    settings.setLibraryBundlificationRules(ContainerUtil.newArrayList(myRulesModel.getItems()));
  }
コード例 #3
0
 public void resetTo(ApplicationSettings settings) {
   myLastSelected = -1;
   myRulesModel.replaceAll(settings.getLibraryBundlificationRules());
   myRulesList.setSelectedIndex(0);
   updateFields();
 }