Skip to content

Commit

Permalink
Rename BibtexEntryWriter to BibEntryWriter to follow consistency of r…
Browse files Browse the repository at this point in the history
…ecent changes
  • Loading branch information
koppor committed Dec 22, 2015
1 parent 66fff4e commit edcb399
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.google.common.base.Strings;
import net.sf.jabref.model.entry.EntryType;

public class BibtexEntryWriter {
public class BibEntryWriter {

private static final Map<String, List<String>> requiredFieldsSorted = new HashMap<>();

Expand Down Expand Up @@ -54,7 +54,7 @@ public class BibtexEntryWriter {
private final int writeFieldSortStyle = Globals.prefs.getInt(JabRefPreferences.WRITEFIELD_SORTSTYLE);


public BibtexEntryWriter(LatexFieldFormatter fieldFormatter, boolean write) {
public BibEntryWriter(LatexFieldFormatter fieldFormatter, boolean write) {
this.fieldFormatter = fieldFormatter;
this.write = write;
}
Expand Down Expand Up @@ -324,7 +324,7 @@ private String getFieldDisplayName(String field) {

StringBuilder suffixSB = new StringBuilder();
if (writeFieldAddSpaces) {
for (int i = BibtexEntryWriter.maxFieldLength - field.length(); i > 0; i--) {
for (int i = BibEntryWriter.maxFieldLength - field.length(); i > 0; i--) {
suffixSB.append(" ");
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/sf/jabref/exporter/FileActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

import net.sf.jabref.*;
import net.sf.jabref.gui.BibtexFields;
import net.sf.jabref.bibtex.BibtexEntryWriter;
import net.sf.jabref.bibtex.BibEntryWriter;
import net.sf.jabref.bibtex.comparator.BibtexStringComparator;
import net.sf.jabref.bibtex.comparator.CrossRefEntryComparator;
import net.sf.jabref.bibtex.comparator.FieldComparator;
Expand Down Expand Up @@ -216,7 +216,7 @@ public static SaveSession saveDatabase(BibDatabase database,
// sorted as they appear on the screen.
List<BibEntry> sorter = FileActions.getSortedEntries(database, metaData, null, true);

BibtexEntryWriter bibtexEntryWriter = new BibtexEntryWriter(new LatexFieldFormatter(), true);
BibEntryWriter bibtexEntryWriter = new BibEntryWriter(new LatexFieldFormatter(), true);

for (BibEntry entry : sorter) {
exceptionCause = entry;
Expand Down Expand Up @@ -414,7 +414,7 @@ public static SaveSession savePartOfDatabase(BibDatabase database, MetaData meta
Collections.addAll(sorter, bes);
Collections.sort(sorter, new FieldComparatorStack<>(comparators));

BibtexEntryWriter bibtexEntryWriter = new BibtexEntryWriter(new LatexFieldFormatter(), true);
BibEntryWriter bibtexEntryWriter = new BibEntryWriter(new LatexFieldFormatter(), true);

for (BibEntry aSorter : sorter) {
be = aSorter;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/gui/TransferableBibtexEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package net.sf.jabref.gui;

import net.sf.jabref.exporter.LatexFieldFormatter;
import net.sf.jabref.bibtex.BibtexEntryWriter;
import net.sf.jabref.bibtex.BibEntryWriter;
import net.sf.jabref.model.entry.BibEntry;

import javax.swing.*;
Expand Down Expand Up @@ -59,7 +59,7 @@ public Object getTransferData(DataFlavor flavor)
} else if (flavor.equals(DataFlavor.stringFlavor)) {
try {
StringWriter sw = new StringWriter();
BibtexEntryWriter bibtexEntryWriter = new BibtexEntryWriter(new LatexFieldFormatter(), false);
BibEntryWriter bibtexEntryWriter = new BibEntryWriter(new LatexFieldFormatter(), false);
for (BibEntry entry : data) {
bibtexEntryWriter.write(entry, sw);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import javax.swing.event.ChangeListener;
import javax.swing.text.JTextComponent;
import net.sf.jabref.*;
import net.sf.jabref.bibtex.BibtexEntryWriter;
import net.sf.jabref.bibtex.BibEntryWriter;
import net.sf.jabref.gui.actions.Actions;
import net.sf.jabref.gui.fieldeditors.*;
import net.sf.jabref.gui.keyboard.KeyBinding;
Expand Down Expand Up @@ -514,7 +514,7 @@ public void run() {
public static String getSourceString(BibEntry entry) throws IOException {
StringWriter stringWriter = new StringWriter(200);
LatexFieldFormatter formatter = LatexFieldFormatter.buildIgnoreHashes();
new BibtexEntryWriter(formatter, false).write(entry, stringWriter);
new BibEntryWriter(formatter, false).write(entry, stringWriter);

return stringWriter.getBuffer().toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.apache.commons.logging.LogFactory;

import net.sf.jabref.exporter.LatexFieldFormatter;
import net.sf.jabref.bibtex.BibtexEntryWriter;
import net.sf.jabref.bibtex.BibEntryWriter;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.Globals;
import net.sf.jabref.JabRefPreferences;
Expand Down Expand Up @@ -336,7 +336,7 @@ public void stateChanged(ChangeEvent e) {
jta.setEditable(false);
StringWriter sw = new StringWriter();
try {
new BibtexEntryWriter(new LatexFieldFormatter(), false).write(mergedEntry, sw);
new BibEntryWriter(new LatexFieldFormatter(), false).write(mergedEntry, sw);
} catch (IOException ex) {
LOGGER.error("Error in entry" + ": " + ex.getMessage(), ex);
}
Expand Down Expand Up @@ -419,7 +419,7 @@ private void updateAll() {
// Update the Bibtex source view
StringWriter sw = new StringWriter();
try {
new BibtexEntryWriter(new LatexFieldFormatter(), false).write(mergedEntry, sw);
new BibEntryWriter(new LatexFieldFormatter(), false).write(mergedEntry, sw);
} catch (IOException ex) {
LOGGER.error("Error in entry" + ": " + ex.getMessage(), ex);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/gui/worker/SendAsEMailAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import net.sf.jabref.exporter.LatexFieldFormatter;
import net.sf.jabref.gui.BasePanel;
import net.sf.jabref.gui.JabRefFrame;
import net.sf.jabref.bibtex.BibtexEntryWriter;
import net.sf.jabref.bibtex.BibEntryWriter;
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.gui.desktop.JabRefDesktop;
Expand Down Expand Up @@ -78,7 +78,7 @@ public void run() {
BibEntry[] bes = panel.getSelectedEntries();

// write the entries using sw, which is used later to form the email content
BibtexEntryWriter bibtexEntryWriter = new BibtexEntryWriter(new LatexFieldFormatter(), true);
BibEntryWriter bibtexEntryWriter = new BibEntryWriter(new LatexFieldFormatter(), true);

for (BibEntry entry : bes) {
try {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/logic/xmp/XMPUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import net.sf.jabref.importer.ParserResult;

import net.sf.jabref.model.entry.*;
import net.sf.jabref.bibtex.BibtexEntryWriter;
import net.sf.jabref.bibtex.BibEntryWriter;
import net.sf.jabref.model.database.BibDatabase;
import org.apache.jempbox.impl.DateConverter;
import org.apache.jempbox.impl.XMLUtil;
Expand Down Expand Up @@ -1185,7 +1185,7 @@ public static void main(String[] args) throws IOException,
// Read from pdf and write as BibTex
List<BibEntry> l = XMPUtil.readXMP(new File(args[0]));

BibtexEntryWriter bibtexEntryWriter = new BibtexEntryWriter(new LatexFieldFormatter(), false);
BibEntryWriter bibtexEntryWriter = new BibEntryWriter(new LatexFieldFormatter(), false);

for (BibEntry entry : l) {
StringWriter sw = new StringWriter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
import net.sf.jabref.exporter.LatexFieldFormatter;
import net.sf.jabref.gui.*;
import net.sf.jabref.gui.keyboard.KeyBinding;
import net.sf.jabref.bibtex.BibtexEntryWriter;
import net.sf.jabref.bibtex.BibEntryWriter;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.Globals;
import net.sf.jabref.JabRef;
Expand Down Expand Up @@ -500,7 +500,7 @@ private boolean parseWithFreeCiteAndAddEntries() {
private void updateSourceView() {
StringWriter sw = new StringWriter(200);
try {
new BibtexEntryWriter(new LatexFieldFormatter(), false).write(entry, sw);
new BibEntryWriter(new LatexFieldFormatter(), false).write(entry, sw);
String srcString = sw.getBuffer().toString();
preview.setText(srcString);
} catch (IOException ignored) {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/net/sf/jabref/bibtex/BibEntryWriterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public class BibEntryWriterTest {

private BibtexEntryWriter writer;
private BibEntryWriter writer;
private static JabRefPreferences backup;

@BeforeClass
Expand All @@ -43,7 +43,7 @@ public static void tearDown() {

@Before
public void setUpWriter() {
writer = new BibtexEntryWriter(new LatexFieldFormatter(), true);
writer = new BibEntryWriter(new LatexFieldFormatter(), true);
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/net/sf/jabref/util/XMPUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.sf.jabref.logic.xmp.XMPSchemaBibtex;
import net.sf.jabref.logic.xmp.XMPUtil;
import net.sf.jabref.model.entry.AuthorList;
import net.sf.jabref.bibtex.BibtexEntryWriter;
import net.sf.jabref.bibtex.BibEntryWriter;
import net.sf.jabref.model.entry.IdGenerator;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.model.entry.BibtexEntryTypes;
Expand Down Expand Up @@ -116,7 +116,7 @@ public static BibEntry bibtexString2BibtexEntry(String s) throws IOException {

public static String bibtexEntry2BibtexString(BibEntry e) throws IOException {
StringWriter sw = new StringWriter();
new BibtexEntryWriter(new LatexFieldFormatter(), false).write(e, sw);
new BibEntryWriter(new LatexFieldFormatter(), false).write(e, sw);
return sw.getBuffer().toString();
}

Expand Down

0 comments on commit edcb399

Please sign in to comment.