Skip to content

Commit 29155ef

Browse files
committed
Merge remote-tracking branch 'upstream/master' into convertSearchWorker
* upstream/master: Remove UI ThreadList for maintable as it prevents sorting in maintable (#4964) fix map collision (#4962) Added a link to the current open issues with tags 'good first issue' to the beginning of CONTRIBUTING.md to help new contributors find a way to get started. (#4960) Fixed the tab order in the database login dialog (#4955)
2 parents 2db6403 + 3baa6bd commit 29155ef

File tree

5 files changed

+108
-94
lines changed

5 files changed

+108
-94
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
After reading through this guide, check out some good first issues to contribute to by clicking here: [Good First Issues](https://github.com/JabRef/jabref/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
2+
13
## Understanding the basics
24
We welcome contributions to JabRef and encourage to create a fork, clone, **create a new branch** (such as `fix-for-issue-121`), **work on the new branch — not master**, and create a pull request.
35
Be sure to create a **separate branch** for each improvement you implement.

src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ public void execute() {
6969
}
7070
}
7171

72-
Task<Map<Optional<URL>, BibEntry>> findFullTextsTask = new Task<Map<Optional<URL>, BibEntry>>() {
72+
Task<Map<BibEntry, Optional<URL>>> findFullTextsTask = new Task<Map<BibEntry, Optional<URL>>>() {
7373
@Override
74-
protected Map<Optional<URL>, BibEntry> call() {
75-
Map<Optional<URL>, BibEntry> downloads = new ConcurrentHashMap<>();
74+
protected Map<BibEntry, Optional<URL>> call() {
75+
Map<BibEntry, Optional<URL>> downloads = new ConcurrentHashMap<>();
7676
int count = 0;
7777
for (BibEntry entry : basePanel.getSelectedEntries()) {
7878
FulltextFetchers fetchers = new FulltextFetchers(Globals.prefs.getImportFormatPreferences());
79-
downloads.put(fetchers.findFullTextPDF(entry), entry);
79+
downloads.put(entry, fetchers.findFullTextPDF(entry));
8080
updateProgress(++count, basePanel.getSelectedEntries().size());
8181
}
8282
return downloads;
@@ -93,10 +93,10 @@ protected Map<Optional<URL>, BibEntry> call() {
9393
Globals.TASK_EXECUTOR.execute(findFullTextsTask);
9494
}
9595

96-
private void downloadFullTexts(Map<Optional<URL>, BibEntry> downloads) {
97-
for (Map.Entry<Optional<URL>, BibEntry> download : downloads.entrySet()) {
98-
BibEntry entry = download.getValue();
99-
Optional<URL> result = download.getKey();
96+
private void downloadFullTexts(Map<BibEntry, Optional<URL>> downloads) {
97+
for (Map.Entry<BibEntry, Optional<URL>> download : downloads.entrySet()) {
98+
BibEntry entry = download.getKey();
99+
Optional<URL> result = download.getValue();
100100
if (result.isPresent()) {
101101
Optional<Path> dir = basePanel.getBibDatabaseContext().getFirstExistingFileDir(Globals.prefs.getFilePreferences());
102102

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import org.jabref.gui.keyboard.KeyBindingRepository;
3737
import org.jabref.gui.undo.NamedCompound;
3838
import org.jabref.gui.undo.UndoableInsertEntry;
39-
import org.jabref.gui.util.BindingsHelper;
4039
import org.jabref.gui.util.CustomLocalDragboard;
4140
import org.jabref.gui.util.ViewModelTableRowFactory;
4241
import org.jabref.logic.l10n.Localization;
@@ -109,7 +108,7 @@ public MainTable(MainTableDataModel model, JabRefFrame frame,
109108
}
110109
this.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
111110

112-
this.setItems(BindingsHelper.forUI(model.getEntriesFilteredAndSorted()));
111+
this.setItems(model.getEntriesFilteredAndSorted());
113112
// Enable sorting
114113
model.getEntriesFilteredAndSorted().comparatorProperty().bind(this.comparatorProperty());
115114

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public class MainTableDataModel {
2323
private final SortedList<BibEntryTableViewModel> entriesSorted;
2424

2525
public MainTableDataModel(BibDatabaseContext context) {
26-
ObservableList<BibEntry> allEntries = context.getDatabase().getEntries();
27-
26+
ObservableList<BibEntry> allEntries = BindingsHelper.forUI(context.getDatabase().getEntries());
27+
2828
ObservableList<BibEntryTableViewModel> entriesViewModel = BindingsHelper.mapBacked(allEntries, BibEntryTableViewModel::new);
29-
29+
3030
entriesFiltered = new FilteredList<>(entriesViewModel);
3131
entriesFiltered.predicateProperty().bind(
3232
Bindings.createObjectBinding(() -> this::isMatched,

src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialog.fxml

Lines changed: 94 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -13,89 +13,102 @@
1313
<?import javafx.scene.layout.ColumnConstraints?>
1414
<?import javafx.scene.layout.GridPane?>
1515
<?import javafx.scene.layout.RowConstraints?>
16-
<DialogPane minHeight="-Infinity" minWidth="-Infinity" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.shared.SharedDatabaseLoginDialogView">
17-
<content>
18-
<BorderPane>
19-
<center>
20-
<BorderPane BorderPane.alignment="TOP_LEFT">
21-
<center>
22-
<GridPane BorderPane.alignment="CENTER">
16+
<DialogPane minHeight="-Infinity" minWidth="-Infinity" xmlns="http://javafx.com/javafx/8.0.141"
17+
xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.shared.SharedDatabaseLoginDialogView">
18+
<content>
19+
<BorderPane>
20+
<center>
21+
<BorderPane BorderPane.alignment="TOP_LEFT">
22+
<center>
23+
<GridPane BorderPane.alignment="CENTER">
24+
<columnConstraints>
25+
<ColumnConstraints hgrow="SOMETIMES" minWidth="20.0" prefWidth="120.0"/>
26+
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
27+
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
28+
</columnConstraints>
29+
<rowConstraints>
30+
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
31+
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
32+
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
33+
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
34+
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
35+
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
36+
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
37+
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
38+
<RowConstraints/>
39+
</rowConstraints>
40+
<children>
41+
<Label text="%Database Type:"/>
42+
<ComboBox fx:id="databaseType" prefHeight="25.0" prefWidth="606.0"
43+
GridPane.columnIndex="1" GridPane.columnSpan="2"/>
44+
<Label text="%Host/Port:" GridPane.rowIndex="1"/>
45+
<TextField fx:id="host" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
46+
<TextField fx:id="port" prefHeight="25.0" prefWidth="66.0" GridPane.columnIndex="2"
47+
GridPane.rowIndex="1"/>
48+
<Label text="%Database:" GridPane.rowIndex="2"/>
49+
<TextField fx:id="database" GridPane.columnIndex="1" GridPane.columnSpan="2"
50+
GridPane.rowIndex="2"/>
51+
<Label text="%User:" GridPane.rowIndex="3"/>
52+
<TextField fx:id="user" GridPane.columnIndex="1" GridPane.columnSpan="2"
53+
GridPane.rowIndex="3"/>
54+
<Label text="%Password:" GridPane.rowIndex="4"/>
55+
<PasswordField fx:id="password" GridPane.columnIndex="1" GridPane.columnSpan="2"
56+
GridPane.rowIndex="4"/>
57+
<CheckBox fx:id="useSSL" mnemonicParsing="false" text="%Use SSL" GridPane.rowIndex="5"/>
58+
<CheckBox fx:id="rememberPassword" mnemonicParsing="false" text="%Remember Password"
59+
GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="5"/>
60+
<Label text="%Keystore:" GridPane.rowIndex="6"/>
61+
<TextField fx:id="fileKeystore" GridPane.columnIndex="1" GridPane.rowIndex="6"/>
62+
<Button fx:id="browseKeystore" mnemonicParsing="false"
63+
onAction="#showOpenKeystoreFileDialog" text="%Browse" GridPane.columnIndex="2"
64+
GridPane.rowIndex="6"/>
65+
<Label text="%Keystore password:" GridPane.rowIndex="7"/>
66+
<PasswordField fx:id="passwordKeystore" GridPane.columnIndex="1" GridPane.rowIndex="7"/>
67+
<Label text="%Server Timezone:" GridPane.rowIndex="8"/>
68+
<TextField fx:id="serverTimezone" GridPane.columnIndex="1" GridPane.columnSpan="2"
69+
GridPane.rowIndex="8"/>
70+
<GridPane>
71+
<columnConstraints>
72+
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
73+
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
74+
</columnConstraints>
75+
<rowConstraints>
76+
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
77+
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
78+
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
79+
</rowConstraints>
80+
</GridPane>
81+
</children>
82+
</GridPane>
83+
</center>
84+
</BorderPane>
85+
</center>
86+
<bottom>
87+
<GridPane BorderPane.alignment="CENTER">
2388
<columnConstraints>
24-
<ColumnConstraints hgrow="SOMETIMES" minWidth="20.0" prefWidth="120.0" />
25-
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
26-
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
89+
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
90+
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
2791
</columnConstraints>
2892
<rowConstraints>
29-
<RowConstraints minHeight="10.0" prefHeight="30.0" />
30-
<RowConstraints minHeight="10.0" prefHeight="30.0" />
31-
<RowConstraints minHeight="10.0" prefHeight="30.0" />
32-
<RowConstraints minHeight="10.0" prefHeight="30.0" />
33-
<RowConstraints minHeight="10.0" prefHeight="30.0" />
34-
<RowConstraints minHeight="10.0" prefHeight="30.0" />
35-
<RowConstraints minHeight="10.0" prefHeight="30.0" />
36-
<RowConstraints minHeight="10.0" prefHeight="30.0" />
93+
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
94+
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
3795
</rowConstraints>
38-
<children>
39-
<Label text="%Database Type:" />
40-
<ComboBox fx:id="databaseType" prefHeight="25.0" prefWidth="606.0" GridPane.columnIndex="1" GridPane.columnSpan="2" />
41-
<Label text="%Host/Port:" GridPane.rowIndex="1" />
42-
<TextField fx:id="host" GridPane.columnIndex="1" GridPane.rowIndex="1" />
43-
<TextField fx:id="database" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="2" />
44-
<TextField fx:id="port" prefHeight="25.0" prefWidth="66.0" GridPane.columnIndex="2" GridPane.rowIndex="1" />
45-
<Label text="%Database:" GridPane.rowIndex="2" />
46-
<Label text="%User:" GridPane.rowIndex="3" />
47-
<TextField fx:id="user" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="3" />
48-
<Label text="%Password:" GridPane.rowIndex="4" />
49-
<PasswordField fx:id="password" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="4" />
50-
<CheckBox fx:id="rememberPassword" mnemonicParsing="false" text="%Remember Password" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="5" />
51-
<CheckBox fx:id="useSSL" mnemonicParsing="false" text="%Use SSL" GridPane.rowIndex="5" />
52-
<TextField fx:id="fileKeystore" GridPane.columnIndex="1" GridPane.rowIndex="6" />
53-
<Button fx:id="browseKeystore" mnemonicParsing="false" onAction="#showOpenKeystoreFileDialog" text="%Browse" GridPane.columnIndex="2" GridPane.rowIndex="6" />
54-
<Label text="%Server Timezone:" GridPane.rowIndex="8"/>
55-
<TextField fx:id="serverTimezone" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="8" />
56-
<GridPane>
57-
<columnConstraints>
58-
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
59-
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
60-
</columnConstraints>
61-
<rowConstraints>
62-
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
63-
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
64-
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
65-
</rowConstraints>
66-
</GridPane>
67-
<PasswordField fx:id="passwordKeystore" GridPane.columnIndex="1" GridPane.rowIndex="7" />
68-
<Label text="%Keystore:" GridPane.rowIndex="6" />
69-
<Label text="%Keystore password:" GridPane.rowIndex="7" />
70-
</children>
71-
</GridPane>
72-
</center>
73-
</BorderPane>
74-
</center>
75-
<bottom>
76-
<GridPane BorderPane.alignment="CENTER">
77-
<columnConstraints>
78-
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
79-
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
80-
</columnConstraints>
81-
<rowConstraints>
82-
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
83-
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
84-
</rowConstraints>
85-
<children>
86-
<CheckBox fx:id="autosave" mnemonicParsing="false" text="%Automatically save the library to" GridPane.columnSpan="2" />
87-
<TextField fx:id="folder" GridPane.rowIndex="1" />
88-
<Button fx:id="browseButton" mnemonicParsing="false" onAction="#showSaveDbToFileDialog" text="%Browse" GridPane.columnIndex="1" GridPane.rowIndex="1" />
89-
<Group />
90-
</children>
91-
</GridPane>
92-
</bottom>
93-
</BorderPane>
94-
</content>
95-
<header>
96-
</header>
97-
<buttonTypes>
98-
<ButtonType fx:constant="CLOSE" />
99-
<ButtonType fx:id="connectButton" buttonData="OK_DONE" text="%Connect" />
100-
</buttonTypes>
96+
<children>
97+
<CheckBox fx:id="autosave" mnemonicParsing="false" text="%Automatically save the library to"
98+
GridPane.columnSpan="2"/>
99+
<TextField fx:id="folder" GridPane.rowIndex="1"/>
100+
<Button fx:id="browseButton" mnemonicParsing="false" onAction="#showSaveDbToFileDialog"
101+
text="%Browse" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
102+
<Group/>
103+
</children>
104+
</GridPane>
105+
</bottom>
106+
</BorderPane>
107+
</content>
108+
<header>
109+
</header>
110+
<buttonTypes>
111+
<ButtonType fx:constant="CLOSE"/>
112+
<ButtonType fx:id="connectButton" buttonData="OK_DONE" text="%Connect"/>
113+
</buttonTypes>
101114
</DialogPane>

0 commit comments

Comments
 (0)