コード例 #1
0
ファイル: CleanUpAction.java プロジェクト: jkulesza/jabref
 /** Converts HTML code to LaTeX code */
 private static void doConvertHTML(BibtexEntry entry, NamedCompound ce) {
   final String field = "title";
   String oldValue = entry.getField(field);
   if (oldValue == null) {
     return;
   }
   final HTMLConverter htmlConverter = new HTMLConverter();
   String newValue = htmlConverter.format(oldValue);
   if (!oldValue.equals(newValue)) {
     entry.setField(field, newValue);
     ce.addEdit(new UndoableFieldChange(entry, field, oldValue, newValue));
   }
 }
コード例 #2
0
ファイル: CleanUpAction.java プロジェクト: jkulesza/jabref
 /** Converts Unicode characters to LaTeX code */
 private static void doConvertUnicode(BibtexEntry entry, NamedCompound ce) {
   final String[] fields = {"title", "author", "abstract"};
   for (String field : fields) {
     String oldValue = entry.getField(field);
     if (oldValue == null) {
       return;
     }
     final HTMLConverter htmlConverter = new HTMLConverter();
     String newValue = htmlConverter.formatUnicode(oldValue);
     if (!oldValue.equals(newValue)) {
       entry.setField(field, newValue);
       ce.addEdit(new UndoableFieldChange(entry, field, oldValue, newValue));
     }
   }
 }
コード例 #3
0
 @Override
 public List<FieldChange> cleanup(BibEntry entry) {
   ArrayList<FieldChange> changes = new ArrayList<>();
   final String[] fields = {"title", "author", "abstract"};
   for (String field : fields) {
     String oldValue = entry.getField(field);
     if (oldValue == null) {
       break;
     }
     final HTMLConverter htmlConverter = new HTMLConverter();
     String newValue = htmlConverter.formatUnicode(oldValue);
     if (!oldValue.equals(newValue)) {
       entry.setField(field, newValue);
       changes.add(new FieldChange(entry, field, oldValue, newValue));
     }
   }
   return changes;
 }
コード例 #4
0
ファイル: ACMPortalFetcher.java プロジェクト: steimlfk/jabref
  /**
   * This method must convert HTML style char sequences to normal characters.
   *
   * @param text The text to handle.
   * @return The converted text.
   */
  private String convertHTMLChars(String text) {

    return htmlConverter.format(text);
  }