public void setEntry(BibtexEntry entry) { try { updating = true; for (FieldEditor editor : editors.values()) { Object content = entry.getField(editor.getFieldName()); String toSet = (content == null) ? "" : content.toString(); if (!toSet.equals(editor.getText())) editor.setText(toSet); } this.entry = entry; } finally { updating = false; } }
public void setEntry(BibtexEntry entry) { try { updating = true; Iterator<FieldEditor> i = editors.values().iterator(); while (i.hasNext()) { FieldEditor editor = i.next(); Object content = entry.getField(editor.getFieldName()); String toSet = (content == null) ? "" : content.toString(); if (!toSet.equals(editor.getText())) editor.setText(toSet); } this.entry = entry; } finally { updating = false; } }
public boolean updateField(String field, String content) { if (!editors.containsKey(field)) return false; FieldEditor ed = editors.get(field); ed.setText(content); return true; }