Skip to content

Commit

Permalink
Remove dependency on java-diff-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Dec 8, 2016
1 parent 54fe85b commit 37c8fb6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 216 deletions.
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ dependencies {
compile 'org.openoffice:ridl:4.1.2'
compile 'org.openoffice:unoil:4.1.2'

compile 'com.github.bkromhout:java-diff-utils:2.1.1'

antlr3 'org.antlr:antlr:3.5.2'
compile 'org.antlr:antlr-runtime:3.5.2'

Expand Down
5 changes: 0 additions & 5 deletions external-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ Project: Apache Commons Logging
URL: http://commons.apache.org/logging/
License: Apache-2.0

Id: com.github.bkromhout:java-diff-utils
Project: java-diff-utils
URL: https://github.com/bkromhout/java-diff-utils
License: Apache-2.0

Id: com.jgoodies:jgoodies-common
Project: JGoodies Common
URL: http://www.jgoodies.com/downloads/libraries/
Expand Down
32 changes: 5 additions & 27 deletions src/main/java/net/sf/jabref/gui/mergeentries/MergeEntries.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import net.sf.jabref.logic.bibtex.LatexFieldFormatter;
import net.sf.jabref.logic.formatter.casechanger.SentenceCaseFormatter;
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.logic.util.strings.DiffHighlighting;
import net.sf.jabref.model.database.BibDatabaseMode;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.model.entry.InternalBibtexFields;
Expand Down Expand Up @@ -272,7 +271,7 @@ private void setupEntryTypeRow(JPanel mergePanel) {
mergePanel.add(boldFontLabel(Localization.lang("Entry type")), CELL_CONSTRAINTS.xy(1, 1));

JTextPane leftTypeDisplay = new DiffHighlightingTextPane();
leftTypeDisplay.setText(DiffHighlighting.HTML_START + leftEntry.getType() + DiffHighlighting.HTML_END);
leftTypeDisplay.setText(leftEntry.getType());
mergePanel.add(leftTypeDisplay, CELL_CONSTRAINTS.xy(3, 1));
if (leftEntry.getType().equals(rightEntry.getType())) {
identicalTypes = true;
Expand All @@ -290,13 +289,14 @@ private void setupEntryTypeRow(JPanel mergePanel) {
typeRadioButtons.get(0).setSelected(true);
}
JTextPane rightTypeDisplay = new DiffHighlightingTextPane();
rightTypeDisplay.setText(DiffHighlighting.HTML_START + rightEntry.getType() + DiffHighlighting.HTML_END);
rightTypeDisplay.setText(rightEntry.getType());
mergePanel.add(rightTypeDisplay, CELL_CONSTRAINTS.xy(11, 1));
}

private void setupHeadingRows() {
mainPanel.add(boldFontLabel(Localization.lang("Use")), CELL_CONSTRAINTS.xyw(4, 1, 7, "center, bottom"));
mainPanel.add(diffMode, CELL_CONSTRAINTS.xy(11, 1, "right, bottom"));
diffMode.setVisible(false);

// Set headings
for (int i = 0; i < 6; i++) {
Expand Down Expand Up @@ -362,33 +362,11 @@ private void updateTextPanes(Collection<String> fields) {
for (String field : fields) {
String leftString = leftEntry.getField(field).orElse("");
String rightString = rightEntry.getField(field).orElse("");
switch (diffMode.getSelectedIndex()) {
case 0: // Plain text
break;
case 1: // Latexdiff style - word
rightString = DiffHighlighting.generateDiffHighlighting(leftString, rightString, " ");
break;
case 2: // Latexdiff style - character
rightString = DiffHighlighting.generateDiffHighlighting(leftString, rightString, "");
break;
case 3: // Symmetric style - word
String tmpLeftString = DiffHighlighting.generateSymmetricHighlighting(leftString, rightString, " ");
rightString = DiffHighlighting.generateSymmetricHighlighting(rightString, leftString, " ");
leftString = tmpLeftString;
break;
case 4: // Symmetric style - character
tmpLeftString = DiffHighlighting.generateSymmetricHighlighting(leftString, rightString, "");
rightString = DiffHighlighting.generateSymmetricHighlighting(rightString, leftString, "");
leftString = tmpLeftString;
break;
default: // Shouldn't happen
break;
}
if ((leftString != null) && leftTextPanes.containsKey(field)) {
leftTextPanes.get(field).setText(DiffHighlighting.HTML_START + leftString + DiffHighlighting.HTML_END);
leftTextPanes.get(field).setText(leftString);
}
if ((rightString != null) && rightTextPanes.containsKey(field)) {
rightTextPanes.get(field).setText(DiffHighlighting.HTML_START + rightString + DiffHighlighting.HTML_END);
rightTextPanes.get(field).setText(rightString);
}
}
SwingUtilities.invokeLater(() -> scrollPane.getVerticalScrollBar()
Expand Down
101 changes: 0 additions & 101 deletions src/main/java/net/sf/jabref/logic/util/strings/DiffHighlighting.java

This file was deleted.

This file was deleted.

0 comments on commit 37c8fb6

Please sign in to comment.