Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into convertSearchWorker
Browse files Browse the repository at this point in the history
* upstream/master:
  Throw BibEntryNotFound exception in case entry is no longer present  (#4935)
  Improve author parsing (#4931)
  Ui preferences global modifications (#4926)
  Bump checkstyle from 8.19 to 8.20 (#4928)
  Bump mysql-connector-java from 8.0.15 to 8.0.16 (#4924)
  UI Preferences->advanced tab optimization : separators and text modification (#4922)

# Conflicts:
#	src/main/java/org/jabref/gui/search/SearchWorker.java
  • Loading branch information
Siedlerchr committed May 1, 2019
2 parents b374c0e + f1b4b5b commit 669dc1a
Show file tree
Hide file tree
Showing 58 changed files with 323 additions and 295 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where a non-existing aux file in a group made it impossible to open the library. [#4735](https://github.com/JabRef/jabref/issues/4735)
- We fixed an issue where some journal names were wrongly marked as abbreviated. [#4115](https://github.com/JabRef/jabref/issues/4115)
- We fixed an issue where the custom file column were sorted incorrectly. https://github.com/JabRef/jabref/issues/3119
- We improved the parsing of author names whose infix is abbreviated without a dot. [#4864](https://github.com/JabRef/jabref/issues/4864)
- We fixed an issues where the entry losses focus when a field is edited and at the same time used for sorting. https://github.com/JabRef/jabref/issues/3373
- We fixed an issue where the menu on Mac OS was not displayed in the usual Mac-specific way. https://github.com/JabRef/jabref/issues/3146
- We improved the integrity check for page numbers. [#4113](https://github.com/JabRef/jabref/issues/4113) and [feature request in the forum](http://discourse.jabref.org/t/pages-field-allow-use-of-en-dash/1199)
Expand Down Expand Up @@ -112,6 +113,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where ranking an entry would generate an IllegalArgumentException. [#4754](https://github.com/JabRef/jabref/issues/4754)
- We fixed an issue where special characters where removed from non label key generation pattern parts [#4767](https://github.com/JabRef/jabref/issues/4767)
- We fixed an issue where the RIS import would overwite the article date with the value of the acessed date [#4816](https://github.com/JabRef/jabref/issues/4816)
- We fixed an issue where an NullPointer exception was thrown when a referenced entry in an Open/Libre Office document was no longer present in the library. Now an error message with the reference marker of the missing entry is shown. [#4932](https://github.com/JabRef/jabref/issues/4932)



Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ dependencies {
antlr4 'org.antlr:antlr4:4.7.2'
compile 'org.antlr:antlr4-runtime:4.7.2'

compile 'mysql:mysql-connector-java:8.0.15'
compile 'mysql:mysql-connector-java:8.0.16'

compile 'org.postgresql:postgresql:42.2.5'

Expand Down Expand Up @@ -173,7 +173,7 @@ dependencies {
testCompile "org.testfx:testfx-core:4.0.+"
testCompile "org.testfx:testfx-junit5:4.0.+"

checkstyle 'com.puppycrawl.tools:checkstyle:8.19'
checkstyle 'com.puppycrawl.tools:checkstyle:8.20'
}

jacoco {
Expand Down
33 changes: 3 additions & 30 deletions src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
Expand All @@ -55,7 +54,6 @@ public abstract class SuggestionProvider<T> implements Callback<ISuggestionReque
/**
* Create a default suggestion provider based on the toString() method of the generic objects
* @param possibleSuggestions All possible suggestions
* @return
*/
public static <T> SuggestionProvider<T> create(Collection<T> possibleSuggestions) {
return create(null, possibleSuggestions);
Expand All @@ -67,7 +65,6 @@ public static <T> SuggestionProvider<T> create(Collection<T> possibleSuggestions
*
* @param stringConverter A stringConverter which converts generic T into a string
* @param possibleSuggestions All possible suggestions
* @return
*/
public static <T> SuggestionProvider<T> create(Callback<T, String> stringConverter, Collection<T> possibleSuggestions) {
SuggestionProviderString<T> suggestionProvider = new SuggestionProviderString<>(stringConverter);
Expand All @@ -77,15 +74,13 @@ public static <T> SuggestionProvider<T> create(Callback<T, String> stringConvert

/**
* Add the given new possible suggestions to this SuggestionProvider
* @param newPossible
*/
public void addPossibleSuggestions(@SuppressWarnings("unchecked") T... newPossible) {
addPossibleSuggestions(Arrays.asList(newPossible));
}

/**
* Add the given new possible suggestions to this SuggestionProvider
* @param newPossible
*/
public void addPossibleSuggestions(Collection<T> newPossible) {
synchronized (possibleSuggestionsLock) {
Expand Down Expand Up @@ -113,39 +108,21 @@ public final Collection<T> call(final ISuggestionRequest request) {
}
}
}
Collections.sort(suggestions, getComparator());
suggestions.sort(getComparator());
}
return suggestions;
}


/***************************************************************************
* *
* Static methods *
* *
**************************************************************************/

/**
* Get the comparator to order the suggestions
* @return
*/
protected abstract Comparator<T> getComparator();

/**
* Check the given possible suggestion is a match (is a valid suggestion)
* @param suggestion
* @param request
* @return
*/
protected abstract boolean isMatch(T suggestion, ISuggestionRequest request);


/***************************************************************************
* *
* Default implementations *
* *
**************************************************************************/

/**
* This is a simple string based suggestion provider.
* All generic suggestions T are turned into strings for processing.
Expand All @@ -166,18 +143,14 @@ public int compare(T o1, T o2) {

/**
* Create a new SuggestionProviderString
* @param stringConverter
*/
public SuggestionProviderString(Callback<T, String> stringConverter) {
this.stringConverter = stringConverter;

// In case no stringConverter was provided, use the default strategy
if (this.stringConverter == null) {
this.stringConverter = new Callback<T, String>() {
@Override
public String call(T obj) {
return obj != null ? obj.toString() : ""; //$NON-NLS-1$
}
this.stringConverter = obj -> {
return obj != null ? obj.toString() : ""; //$NON-NLS-1$
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public void setAccepted(boolean a) {
accepted = a;
}


/**
* This method returns a JComponent detailing the nature of the change.
* @return JComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ private void move(int dy) {
list.setSelectedIndex(newInd);
}


/**
* FocusListener to select the first entry in the list of fields when they are focused
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ private void saveAbbreviationsAndCloseDialog() {
close();
}


/**
* This class provides a editable text field that is used as table cell.
* It handles the editing of the name column.
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/openoffice/OOBibBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ private List<String> refreshCiteMarkersInternal(List<BibDatabase> databases, OOB
} else {
LOGGER.info("BibTeX key not found: '" + keys[j] + '\'');
LOGGER.info("Problem with reference mark: '" + names.get(i) + '\'');
cEntries[j] = new UndefinedBibtexEntry(keys[j]);
throw new BibEntryNotFoundException(names.get(i), Localization
.lang("Could not resolve BibTeX entry for citation marker '%0'.", names.get(i)));
}
}

Expand Down
58 changes: 19 additions & 39 deletions src/main/java/org/jabref/gui/preferences/AdvancedTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Optional;

import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
Expand All @@ -11,7 +12,7 @@
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.shape.Line;
import javafx.scene.text.Text;

import org.jabref.Globals;
import org.jabref.gui.DialogService;
Expand Down Expand Up @@ -44,6 +45,7 @@ public AdvancedTab(DialogService dialogService, JabRefPreferences prefs) {
this.dialogService = dialogService;
preferences = prefs;
remotePreferences = prefs.getRemotePreferences();
builder.setVgap(7);

useRemoteServer = new CheckBox(Localization.lang("Listen for remote operation on port") + ':');
useIEEEAbrv = new CheckBox(Localization.lang("Use IEEE LaTeX abbreviations"));
Expand All @@ -54,56 +56,34 @@ public AdvancedTab(DialogService dialogService, JabRefPreferences prefs) {
Label remoteOperation = new Label(Localization.lang("Remote operation"));
remoteOperation.getStyleClass().add("sectionHeader");
builder.add(remoteOperation, 2, 1);
builder.add(new Separator(), 2, 1);
builder.add(new Pane(), 1, 2);
Label label1 = new Label(Localization.lang("This feature lets new files be opened or imported into an "

+ "already running instance of JabRef<BR>instead of opening a new instance. For instance, this "

+ "is useful when you open a file in JabRef<br>from your web browser."

+ "<BR>Note that this will prevent you from running more than one instance of JabRef at a time."));
label1.setVisible(false);
builder.add(label1, 2, 22);

Label textLabel1 = new Label(" This feature lets new files be opened or imported into an already running instance of JabRef instead of opening a new instance. For");
builder.add(textLabel1, 2, 3);
Label textLabel2 = new Label("instance, this is useful when you open a file in JabRef from your web browser. ");
builder.add(textLabel2, 2, 4);
Label textLabel3 = new Label(" Note that this will prevent you from running more than one instance of JabRef at a time.");
builder.add(textLabel3, 2, 5);
builder.add(new Line(), 2, 6);
builder.add(new Pane(), 2, 7);
Text textRemote = new Text(Localization.lang("This feature lets new files be opened or imported into an already running instance of JabRef " +
"instead of opening a new instance. For instance, this is useful when you open a file in JabRef " +
"from your web browser. Note that this will prevent you from running more than one instance of JabRef at a time."));
textRemote.setWrappingWidth(600);
builder.add(textRemote, 2, 4);

HBox p = new HBox();
p.getChildren().add(useRemoteServer);
p.getChildren().add(remoteServerPort);

p.setSpacing(8);
p.setAlignment(Pos.CENTER_LEFT);
ActionFactory factory = new ActionFactory(preferences.getKeyBindingRepository());
Button help = factory.createIconButton(StandardActions.HELP, new HelpAction(HelpFile.REMOTE));
help.setMaxWidth(Double.MAX_VALUE);
p.getChildren().add(help);

builder.add(p, 2, 9);
builder.add(new Label(""), 1, 10);
p.getChildren().setAll(useRemoteServer, remoteServerPort, help);
builder.add(p, 2, 6);

builder.add(new Separator(), 2, 11);
Label explore = new Label(Localization.lang("Search %0", "IEEEXplore"));
explore.getStyleClass().add("sectionHeader");
builder.add(explore, 2, 11);
builder.add(new Separator(), 2, 11);
builder.add(new Pane(), 2, 12);
builder.add(useIEEEAbrv, 2, 13);

builder.add(new Line(), 2, 16);
builder.add(new Label(""), 1, 17);
builder.add(explore, 2, 12);
builder.add(useIEEEAbrv, 2, 14);

builder.add(new Separator(), 2, 19);
Label importConversions = new Label(Localization.lang("Import conversions"));
importConversions.getStyleClass().add("sectionHeader");
builder.add(importConversions, 2, 18);
builder.add(importConversions, 2, 20);

builder.add(useCaseKeeperOnSearch, 2, 19);
builder.add(new Pane(), 2, 20);
builder.add(useUnitFormatterOnSearch, 2, 21);
builder.add(useCaseKeeperOnSearch, 2, 21);
builder.add(useUnitFormatterOnSearch, 2, 23);

}

Expand Down
26 changes: 18 additions & 8 deletions src/main/java/org/jabref/gui/preferences/AppearancePrefsTab.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.jabref.gui.preferences;

import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;

import org.jabref.gui.DialogService;
import org.jabref.gui.util.ControlHelper;
Expand All @@ -24,10 +24,10 @@ class AppearancePrefsTab extends Pane implements PrefsTab {
private final CheckBox fontTweaksLAF;
private final TextField fontSize;
private final CheckBox overrideFonts;
private final VBox container = new VBox();
private final DialogService dialogService;
private final RadioButton lightTheme;
private final RadioButton darkTheme;
private final GridPane builder = new GridPane();

/**
* Customization of appearance parameters.
Expand All @@ -37,14 +37,12 @@ class AppearancePrefsTab extends Pane implements PrefsTab {
public AppearancePrefsTab(DialogService dialogService, JabRefPreferences prefs) {
this.dialogService = dialogService;
this.prefs = prefs;
builder.setVgap(8);

overrideFonts = new CheckBox(Localization.lang("Override default font settings"));
fontSize = new TextField();
fontSize.setTextFormatter(ControlHelper.getIntegerTextFormatter());
Label fontSizeLabel = new Label(Localization.lang("Font size:"));
HBox fontSizeContainer = new HBox(fontSizeLabel, fontSize);
VBox.setMargin(fontSizeContainer, new Insets(0, 0, 0, 35));
fontSizeContainer.disableProperty().bind(overrideFonts.selectedProperty().not());
fontTweaksLAF = new CheckBox(Localization.lang("Tweak font rendering for entry editor on Linux"));

ToggleGroup themeGroup = new ToggleGroup();
Expand All @@ -60,12 +58,24 @@ public AppearancePrefsTab(DialogService dialogService, JabRefPreferences prefs)
darkTheme.setSelected(true);
}

container.getChildren().addAll(overrideFonts, fontSizeContainer, fontTweaksLAF, lightTheme, darkTheme);
// Font configuration
HBox fontBox = new HBox();
fontBox.setSpacing(10);
fontBox.setAlignment(Pos.CENTER_LEFT);
fontBox.getChildren().setAll(overrideFonts, fontSizeLabel, fontSize);
builder.add(fontBox, 1, 2);

// Theme configuration
HBox themeBox = new HBox();
themeBox.setSpacing(10);
themeBox.setAlignment(Pos.CENTER_LEFT);
themeBox.getChildren().setAll(lightTheme, darkTheme);
builder.add(themeBox, 1, 4);
}

@Override
public Node getBuilder() {
return container;
return builder;
}

@Override
Expand Down
Loading

0 comments on commit 669dc1a

Please sign in to comment.