コード例 #1
0
 /**
  * @param e - Field to be handled
  * @param value - may be null to state that field should be emptied
  * @param be - BibTeXEntry to be handled
  * @param ce - Filled with undo info (if necessary)
  * @param nullFieldIfValueIsTheSame - true: field is nulled if value is the same than the current
  *     value in be
  */
 public static void updateField(
     SpecialField e,
     String value,
     BibtexEntry be,
     NamedCompound ce,
     boolean nullFieldIfValueIsTheSame) {
   Util.updateField(be, e.getFieldName(), value, ce, nullFieldIfValueIsTheSame);
   // we cannot use "value" here as updateField has side effects: "nullFieldIfValueIsTheSame" nulls
   // the field if value is the same
   SpecialFieldsUtils.exportFieldToKeywords(e, be.getField(e.getFieldName()), be, ce);
 }
コード例 #2
0
 private static void importKeywordsForField(
     ArrayList<String> keywordList, SpecialField c, BibtexEntry be, NamedCompound nc) {
   List<String> values = c.getKeyWords();
   String newValue = null;
   for (String val : values) {
     if (keywordList.contains(val)) {
       newValue = val;
       break;
     }
   }
   Util.updateField(be, c.getFieldName(), newValue, nc);
 }