Skip to content

Commit 9061f37

Browse files
committed
Merge remote-tracking branch 'upstream/master' into change-upload-back-to-script
* upstream/master: Bump mockito-core from 3.2.0 to 3.2.4 (#5760) Bump classgraph from 4.8.58 to 4.8.59 (#5761) Improve dependency update rules Update jpackage to build 27 (#5758) Persistent column sortorder (#5730) Fix medline fetcher/importer when using installer (#5752) New Crowdin translations (#5751) Bump byte-buddy-parent from 1.10.4 to 1.10.5 (#5750) Fix checkstyle Fix filename
2 parents 3b258cd + 300d13f commit 9061f37

20 files changed

+231
-188
lines changed
File renamed without changes.

.github/workflows/deployment.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ jobs:
1111
include:
1212
- os: ubuntu-latest
1313
displayName: linux
14-
jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-70_linux-x64_bin.tar.gz
14+
jpackageDownload: https://download.java.net/java/early_access/jdk14/27/GPL/openjdk-14-ea+27_linux-x64_bin.tar.gz
1515
jdk14Path: /jdk-14
1616
archivePortable: tar -czf build/distribution/JabRef-portable_linux.tar.gz -C build/distribution JabRef && rm -R build/distribution/JabRef
1717
- os: windows-latest
1818
displayName: windows
19-
jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-70_windows-x64_bin.zip
19+
jpackageDownload: https://download.java.net/java/early_access/jdk14/27/GPL/openjdk-14-ea+27_windows-x64_bin.zip
2020
jdk14Path: /jdk-14
2121
archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip ./build/distribution/JabRef && rm -R build/distribution/JabRef
2222
- os: macOS-latest
2323
displayName: macOS
24-
jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-70_osx-x64_bin.tar.gz
24+
jpackageDownload: https://download.java.net/java/early_access/jdk14/27/GPL/openjdk-14-ea+27_osx-x64_bin.tar.gz
2525
jdk14Path: /jdk-14.jdk/Contents/Home
2626
archivePortable: tar -czf build/distribution/JabRef-portable_macos.tar.gz -C build/distribution JabRef.app && rm -R build/distribution/JabRef.app
2727

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
1515

1616
### Fixed
1717

18+
- We fixed an issue where the Medline fetcher was only working when JabRef was running from source [#5645](https://github.com/JabRef/jabref/issues/5645)
19+
20+
1821
### Removed
1922

2023

@@ -34,6 +37,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
3437
- We changed the save action buttons to be easier to understand. [#5565](https://github.com/JabRef/jabref/issues/5565)
3538
- We made the columns for groups, files and uri in the main table reorderable and merged the clickable icon columns for uri, url, doi and eprint. [#5544](https://github.com/JabRef/jabref/pull/5544)
3639
- We reduced the number of write actions performed when autosave is enabled [#5679](https://github.com/JabRef/jabref/issues/5679)
40+
- We made the column sort order in the main table persistent [#5730](https://github.com/JabRef/jabref/pull/5730)
3741

3842
### Fixed
3943

build.gradle

+23-13
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ dependencies {
206206
}
207207

208208

209-
testCompile 'io.github.classgraph:classgraph:4.8.58'
209+
testCompile 'io.github.classgraph:classgraph:4.8.59'
210210
testImplementation 'org.junit.jupiter:junit-jupiter:5.5.2'
211211
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.5.2'
212212
testCompile 'org.junit.platform:junit-platform-launcher:1.5.2'
213213

214-
testCompile 'net.bytebuddy:byte-buddy-parent:1.10.4'
214+
testCompile 'net.bytebuddy:byte-buddy-parent:1.10.5'
215215
testRuntime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT'
216216
testRuntime group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '3.0.0-SNAPSHOT'
217-
testCompile 'org.mockito:mockito-core:3.2.0'
217+
testCompile 'org.mockito:mockito-core:3.2.4'
218218
//testCompile 'com.github.tomakehurst:wiremock:2.24.1'
219219
testCompile 'org.xmlunit:xmlunit-core:2.6.3'
220220
testCompile 'org.xmlunit:xmlunit-matchers:2.6.3'
@@ -249,20 +249,29 @@ dependencyUpdates.resolutionStrategy = {
249249
selection.reject('Release candidate')
250250
}
251251
}
252-
rules.withModule("com.github.tomtung:latex2unicode_2.12") { ComponentSelection selection ->
253-
if (selection.candidate.version ==~ /0.2.*/) {
254-
// Reject version higher than 2.0.2. see https://github.com/JabRef/jabref/pull/3781
255-
selection.reject("Cannot be updated to 0.2.4 until JabRef is prepared for it")
252+
rules.withModule("org.python:jython-standalone") { ComponentSelection selection ->
253+
if (selection.candidate.version ==~ /2.7.2b2/) {
254+
selection.reject('Release candidate')
255+
}
256+
}
257+
rules.withModule("de.jensd:fontawesomefx-materialdesignfont") { ComponentSelection selection ->
258+
if (selection.candidate.version ==~ /2.0.26-9.1.2/) {
259+
selection.reject('1.7.22-11 is actually newer (strange version system)')
260+
}
261+
}
262+
rules.withModule("org.javamodularity.moduleplugin:org.javamodularity.moduleplugin.gradle.plugin") { ComponentSelection selection ->
263+
if (selection.candidate.version ==~ /1.6.0/) {
264+
selection.reject("Does not work due to bug, see https://github.com/JabRef/jabref/pull/5270")
256265
}
257266
}
258-
rules.withModule("com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin") { ComponentSelection selection ->
259-
if (selection.candidate.version ==~ /4.*/) {
260-
selection.reject("Version 4.X breaks the release process.")
267+
rules.withModule("com.microsoft.azure:applicationinsights-core") { ComponentSelection selection ->
268+
if (selection.candidate.version ==~ /2.5.1/) {
269+
selection.reject("Does not work due to bug, see https://github.com/JabRef/jabref/pull/5596")
261270
}
262271
}
263-
rules.withModule("com.google.errorprone:error_prone_core") { ComponentSelection selection ->
264-
if (selection.candidate.version ==~ /2.3.3/) {
265-
selection.reject("Does not work due to bug https://github.com/google/error-prone/issues/1240")
272+
rules.withModule("com.microsoft.azure:applicationinsights-logging-log4j2") { ComponentSelection selection ->
273+
if (selection.candidate.version ==~ /2.5.1/) {
274+
selection.reject("Does not work due to bug, see https://github.com/JabRef/jabref/pull/5596")
266275
}
267276
}
268277
}
@@ -597,6 +606,7 @@ jlink {
597606
uses 'com.airhacks.afterburner.injection.PresenterFactory'
598607
uses 'org.controlsfx.glyphfont.GlyphFont'
599608
uses 'com.airhacks.afterburner.views.ResourceLocator'
609+
uses 'javax.xml.bind.JAXBContextFactory'
600610
provides 'java.sql.Driver' with 'org.postgresql.Driver'
601611
provides 'org.controlsfx.glyphfont.GlyphFont' with 'org.controlsfx.glyphfont.FontAwesome'
602612
provides 'org.apache.commons.logging.LogFactory' with 'org.apache.logging.log4j.jcl.LogFactoryImpl'
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
11
package org.jabref.gui.maintable;
22

33
import java.util.List;
4-
import java.util.Map;
5-
6-
import javafx.scene.control.TableColumn.SortType;
74

85
public class ColumnPreferences {
96

10-
public static final double DEFAULT_WIDTH = 100;
7+
public static final double DEFAULT_COLUMN_WIDTH = 100;
118
public static final double ICON_COLUMN_WIDTH = 16 + 12; // add some additional space to improve appearance
129

1310
private final List<MainTableColumnModel> columns;
14-
private final boolean extraFileColumnsEnabled;
15-
private final Map<String, SortType> columnSortType;
11+
private final List<MainTableColumnModel> columnSortOrder;
1612

17-
public ColumnPreferences(List<MainTableColumnModel> columns, boolean extraFileColumnsEnabled, Map<String, SortType> columnSortType) {
13+
public ColumnPreferences(List<MainTableColumnModel> columns, List<MainTableColumnModel> columnSortOrder) {
1814
this.columns = columns;
19-
this.extraFileColumnsEnabled = extraFileColumnsEnabled;
20-
this.columnSortType = columnSortType;
15+
this.columnSortOrder = columnSortOrder;
2116
}
2217

23-
public boolean getExtraFileColumnsEnabled() { return extraFileColumnsEnabled; }
24-
2518
public List<MainTableColumnModel> getColumns() {
2619
return columns;
2720
}
2821

29-
public Map<String, SortType> getSortTypesForColumns() {
30-
return columnSortType;
22+
public List<MainTableColumnModel> getColumnSortOrder() {
23+
return columnSortOrder;
3124
}
3225
}

src/main/java/org/jabref/gui/maintable/MainTable.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ public MainTable(MainTableDataModel model, JabRefFrame frame,
9797
.setOnMouseDragEntered(this::handleOnDragEntered)
9898
.install(this);
9999

100-
/*for (Entry<String, SortType> entries : preferences.getColumnPreferences().getSortTypesForColumns().entrySet()) {
101-
Optional<TableColumn<BibEntryTableViewModel, ?>> column = this.getColumns().stream().filter(col -> entries.getKey().equals(col.getText())).findFirst();
102-
column.ifPresent(col -> {
103-
col.setSortType(entries.getValue());
104-
this.getSortOrder().add(col);
105-
});
106-
}*/
107-
108-
if (preferences.resizeColumnsToFit()) {
100+
this.getSortOrder().clear();
101+
preferences.getColumnPreferences().getColumnSortOrder().forEach(columnModel ->
102+
this.getColumns().stream()
103+
.map(column -> (MainTableColumn<?>) column)
104+
.filter(column -> column.getModel().equals(columnModel))
105+
.findFirst()
106+
.ifPresent(column -> this.getSortOrder().add(column)));
107+
108+
if (preferences.getResizeColumnsToFit()) {
109109
this.setColumnResizePolicy(new SmartConstrainedResizePolicy());
110110
}
111111
this.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);

src/main/java/org/jabref/gui/maintable/MainTableColumn.java

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.jabref.gui.maintable;
22

3+
import javafx.beans.value.ObservableValue;
34
import javafx.scene.control.TableColumn;
45

56
import org.jabref.gui.util.BindingsHelper;
@@ -16,6 +17,12 @@ public MainTableColumn(MainTableColumnModel model) {
1617
model.widthProperty(),
1718
value -> this.setPrefWidth(model.widthProperty().getValue()),
1819
value -> model.widthProperty().setValue(this.getWidth()));
20+
21+
BindingsHelper.bindBidirectional(
22+
this.sortTypeProperty(),
23+
(ObservableValue<SortType>) model.sortTypeProperty(),
24+
value -> this.setSortType(model.sortTypeProperty().getValue()),
25+
value -> model.sortTypeProperty().setValue(this.getSortType()));
1926
}
2027

2128
public MainTableColumnModel getModel() { return model; }

src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java

+49-37
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.jabref.gui.maintable;
22

3+
import java.util.EnumSet;
34
import java.util.Objects;
45

56
import javafx.beans.property.DoubleProperty;
@@ -9,6 +10,7 @@
910
import javafx.beans.property.SimpleObjectProperty;
1011
import javafx.beans.property.SimpleStringProperty;
1112
import javafx.beans.property.StringProperty;
13+
import javafx.scene.control.TableColumn;
1214

1315
import org.jabref.gui.util.FieldsUtil;
1416
import org.jabref.logic.l10n.Localization;
@@ -35,6 +37,8 @@ public enum Type {
3537
NORMALFIELD("field"),
3638
SPECIALFIELD("special", Localization.lang("Special"));
3739

40+
public static final EnumSet<Type> ICON_COLUMNS = EnumSet.of(EXTRAFILE,FILES,GROUPS,LINKED_IDENTIFIER);
41+
3842
private String name;
3943
private String displayName;
4044

@@ -67,35 +71,54 @@ public static Type fromString(String text) {
6771
}
6872
}
6973

70-
private final ObjectProperty<Type> typeProperty;
71-
private final StringProperty qualifierProperty;
72-
private final DoubleProperty widthProperty;
74+
private final ObjectProperty<Type> typeProperty = new SimpleObjectProperty<>();
75+
private final StringProperty qualifierProperty = new SimpleStringProperty();
76+
private final DoubleProperty widthProperty = new SimpleDoubleProperty();
77+
private final ObjectProperty<TableColumn.SortType> sortTypeProperty = new SimpleObjectProperty<>();
7378

7479
/**
7580
* This is used by the preferences dialog, to initialize available columns the user can add to the table.
7681
*
77-
* @param type the {@code MainTableColumnModel.Type} of the column, e.g. "NORMALFIELD" or "GROUPS"
82+
* @param type the {@code MainTableColumnModel.Type} of the column, e.g. "NORMALFIELD" or "EXTRAFILE"
7883
* @param qualifier the stored qualifier of the column, e.g. "author/editor"
7984
*/
80-
public MainTableColumnModel(Type type, String qualifier, double width) {
85+
public MainTableColumnModel(Type type, String qualifier) {
8186
Objects.requireNonNull(type);
82-
typeProperty = new SimpleObjectProperty<>(type);
83-
qualifierProperty = new SimpleStringProperty(qualifier);
84-
widthProperty = new SimpleDoubleProperty(width);
85-
}
87+
Objects.requireNonNull(qualifier);
8688

87-
public MainTableColumnModel(Type type, String qualifier) {
88-
this(type, qualifier, ColumnPreferences.DEFAULT_WIDTH);
89-
}
89+
this.typeProperty.setValue(type);
90+
this.qualifierProperty.setValue(qualifier);
91+
this.sortTypeProperty.setValue(TableColumn.SortType.ASCENDING);
9092

91-
public MainTableColumnModel(Type type, double width) {
92-
this(type, "", width);
93+
if (Type.ICON_COLUMNS.contains(type)) {
94+
this.widthProperty.setValue(ColumnPreferences.ICON_COLUMN_WIDTH);
95+
} else {
96+
this.widthProperty.setValue(ColumnPreferences.DEFAULT_COLUMN_WIDTH);
97+
}
9398
}
9499

100+
/**
101+
* This is used by the preferences dialog, to initialize available basic icon columns, the user can add to the table.
102+
*
103+
* @param type the {@code MainTableColumnModel.Type} of the column, e.g. "GROUPS" or "LINKED_IDENTIFIER"
104+
*/
95105
public MainTableColumnModel(Type type) {
96106
this(type, "");
97107
}
98108

109+
/**
110+
* This is used by the preference migrations.
111+
*
112+
* @param type the {@code MainTableColumnModel.Type} of the column, e.g. "NORMALFIELD" or "GROUPS"
113+
* @param qualifier the stored qualifier of the column, e.g. "author/editor"
114+
* @param width the stored width of the column
115+
*/
116+
public MainTableColumnModel(Type type, String qualifier, double width) {
117+
this(type, qualifier);
118+
119+
this.widthProperty.setValue(width);
120+
}
121+
99122
public Type getType() { return typeProperty.getValue(); }
100123

101124
public String getQualifier() { return qualifierProperty.getValue(); }
@@ -109,10 +132,7 @@ public String getName() {
109132
}
110133

111134
public String getDisplayName() {
112-
if ((typeProperty.getValue() == Type.GROUPS
113-
|| typeProperty.getValue() == Type.FILES
114-
|| typeProperty.getValue() == Type.LINKED_IDENTIFIER)
115-
&& qualifierProperty.getValue().isBlank()) {
135+
if (Type.ICON_COLUMNS.contains(typeProperty.getValue()) && qualifierProperty.getValue().isBlank()) {
116136
return typeProperty.getValue().getDisplayName();
117137
} else {
118138
return FieldsUtil.getNameWithType(FieldFactory.parseField(qualifierProperty.getValue()));
@@ -121,12 +141,14 @@ public String getDisplayName() {
121141

122142
public StringProperty nameProperty() { return new ReadOnlyStringWrapper(getDisplayName()); }
123143

124-
public double getWidth() {
125-
return widthProperty.get();
126-
}
144+
public double getWidth() { return widthProperty.getValue(); }
127145

128146
public DoubleProperty widthProperty() { return widthProperty; }
129147

148+
public TableColumn.SortType getSortType() { return sortTypeProperty.getValue(); }
149+
150+
public ObjectProperty<TableColumn.SortType> sortTypeProperty() { return sortTypeProperty; }
151+
130152
public boolean equals(Object o) {
131153
if (this == o) {
132154
return true;
@@ -149,23 +171,11 @@ public int hashCode() {
149171
}
150172

151173
/**
152-
* This is used by JabRefPreferences, to create a new ColumnModel out ouf the stored preferences.
174+
* This creates a new {@code MainTableColumnModel} out of a given string
153175
*
154-
* @param rawColumnName the stored name of the column, e.g. "field:author"
155-
* @param width the stored width of the column
156-
*/
157-
public static MainTableColumnModel parse(String rawColumnName, Double width) {
158-
MainTableColumnModel columnModel = parse(rawColumnName);
159-
160-
Objects.requireNonNull(width);
161-
columnModel.widthProperty().setValue(width);
162-
return columnModel;
163-
}
164-
165-
/**
166-
* This is used by the preferences dialog, to allow the user to type in a field he wants to add to the table.
176+
* @param rawColumnName the name of the column, e.g. "field:author", or "author"
167177
*
168-
* @param rawColumnName the stored name of the column, e.g. "field:author", or "author"
178+
* @return A new {@code MainTableColumnModel}
169179
*/
170180
public static MainTableColumnModel parse(String rawColumnName) {
171181
Objects.requireNonNull(rawColumnName);
@@ -174,7 +184,9 @@ public static MainTableColumnModel parse(String rawColumnName) {
174184
Type type = Type.fromString(splittedName[0]);
175185
String qualifier = "";
176186

177-
if (type == Type.NORMALFIELD || type == Type.SPECIALFIELD || type == Type.EXTRAFILE) {
187+
if (type == Type.NORMALFIELD
188+
|| type == Type.SPECIALFIELD
189+
|| type == Type.EXTRAFILE) {
178190
if (splittedName.length == 1) {
179191
qualifier = splittedName[0]; // By default the rawColumnName is parsed as NORMALFIELD
180192
} else {

src/main/java/org/jabref/gui/maintable/MainTablePreferences.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@
33
public class MainTablePreferences {
44
private final ColumnPreferences columnPreferences;
55
private final boolean resizeColumnsToFit;
6+
private final boolean extraFileColumnsEnabled;
67

7-
public MainTablePreferences(ColumnPreferences columnPreferences, boolean resizeColumnsToFit) {
8+
public MainTablePreferences(ColumnPreferences columnPreferences, boolean resizeColumnsToFit, boolean extraFileColumnsEnabled) {
89
this.columnPreferences = columnPreferences;
910
this.resizeColumnsToFit = resizeColumnsToFit;
11+
this.extraFileColumnsEnabled = extraFileColumnsEnabled;
1012
}
1113

1214
public ColumnPreferences getColumnPreferences() {
1315
return columnPreferences;
1416
}
1517

16-
public boolean resizeColumnsToFit() {
18+
public boolean getResizeColumnsToFit() {
1719
return resizeColumnsToFit;
1820
}
21+
22+
public boolean getExtraFileColumnsEnabled() { return extraFileColumnsEnabled; }
1923
}

0 commit comments

Comments
 (0)