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:
  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)
  • Loading branch information
Siedlerchr committed May 12, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 2db6403 + 3baa6bd commit 29155ef
Showing 5 changed files with 108 additions and 94 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
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)

## Understanding the basics
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.
Be sure to create a **separate branch** for each improvement you implement.
Original file line number Diff line number Diff line change
@@ -69,14 +69,14 @@ public void execute() {
}
}

Task<Map<Optional<URL>, BibEntry>> findFullTextsTask = new Task<Map<Optional<URL>, BibEntry>>() {
Task<Map<BibEntry, Optional<URL>>> findFullTextsTask = new Task<Map<BibEntry, Optional<URL>>>() {
@Override
protected Map<Optional<URL>, BibEntry> call() {
Map<Optional<URL>, BibEntry> downloads = new ConcurrentHashMap<>();
protected Map<BibEntry, Optional<URL>> call() {
Map<BibEntry, Optional<URL>> downloads = new ConcurrentHashMap<>();
int count = 0;
for (BibEntry entry : basePanel.getSelectedEntries()) {
FulltextFetchers fetchers = new FulltextFetchers(Globals.prefs.getImportFormatPreferences());
downloads.put(fetchers.findFullTextPDF(entry), entry);
downloads.put(entry, fetchers.findFullTextPDF(entry));
updateProgress(++count, basePanel.getSelectedEntries().size());
}
return downloads;
@@ -93,10 +93,10 @@ protected Map<Optional<URL>, BibEntry> call() {
Globals.TASK_EXECUTOR.execute(findFullTextsTask);
}

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

3 changes: 1 addition & 2 deletions src/main/java/org/jabref/gui/maintable/MainTable.java
Original file line number Diff line number Diff line change
@@ -36,7 +36,6 @@
import org.jabref.gui.keyboard.KeyBindingRepository;
import org.jabref.gui.undo.NamedCompound;
import org.jabref.gui.undo.UndoableInsertEntry;
import org.jabref.gui.util.BindingsHelper;
import org.jabref.gui.util.CustomLocalDragboard;
import org.jabref.gui.util.ViewModelTableRowFactory;
import org.jabref.logic.l10n.Localization;
@@ -109,7 +108,7 @@ public MainTable(MainTableDataModel model, JabRefFrame frame,
}
this.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);

this.setItems(BindingsHelper.forUI(model.getEntriesFilteredAndSorted()));
this.setItems(model.getEntriesFilteredAndSorted());
// Enable sorting
model.getEntriesFilteredAndSorted().comparatorProperty().bind(this.comparatorProperty());

Original file line number Diff line number Diff line change
@@ -23,10 +23,10 @@ public class MainTableDataModel {
private final SortedList<BibEntryTableViewModel> entriesSorted;

public MainTableDataModel(BibDatabaseContext context) {
ObservableList<BibEntry> allEntries = context.getDatabase().getEntries();

ObservableList<BibEntry> allEntries = BindingsHelper.forUI(context.getDatabase().getEntries());
ObservableList<BibEntryTableViewModel> entriesViewModel = BindingsHelper.mapBacked(allEntries, BibEntryTableViewModel::new);

entriesFiltered = new FilteredList<>(entriesViewModel);
entriesFiltered.predicateProperty().bind(
Bindings.createObjectBinding(() -> this::isMatched,
175 changes: 94 additions & 81 deletions src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialog.fxml
Original file line number Diff line number Diff line change
@@ -13,89 +13,102 @@
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<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">
<content>
<BorderPane>
<center>
<BorderPane BorderPane.alignment="TOP_LEFT">
<center>
<GridPane BorderPane.alignment="CENTER">
<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">
<content>
<BorderPane>
<center>
<BorderPane BorderPane.alignment="TOP_LEFT">
<center>
<GridPane BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="20.0" prefWidth="120.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
<RowConstraints minHeight="10.0" prefHeight="30.0"/>
<RowConstraints/>
</rowConstraints>
<children>
<Label text="%Database Type:"/>
<ComboBox fx:id="databaseType" prefHeight="25.0" prefWidth="606.0"
GridPane.columnIndex="1" GridPane.columnSpan="2"/>
<Label text="%Host/Port:" GridPane.rowIndex="1"/>
<TextField fx:id="host" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
<TextField fx:id="port" prefHeight="25.0" prefWidth="66.0" GridPane.columnIndex="2"
GridPane.rowIndex="1"/>
<Label text="%Database:" GridPane.rowIndex="2"/>
<TextField fx:id="database" GridPane.columnIndex="1" GridPane.columnSpan="2"
GridPane.rowIndex="2"/>
<Label text="%User:" GridPane.rowIndex="3"/>
<TextField fx:id="user" GridPane.columnIndex="1" GridPane.columnSpan="2"
GridPane.rowIndex="3"/>
<Label text="%Password:" GridPane.rowIndex="4"/>
<PasswordField fx:id="password" GridPane.columnIndex="1" GridPane.columnSpan="2"
GridPane.rowIndex="4"/>
<CheckBox fx:id="useSSL" mnemonicParsing="false" text="%Use SSL" GridPane.rowIndex="5"/>
<CheckBox fx:id="rememberPassword" mnemonicParsing="false" text="%Remember Password"
GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="5"/>
<Label text="%Keystore:" GridPane.rowIndex="6"/>
<TextField fx:id="fileKeystore" GridPane.columnIndex="1" GridPane.rowIndex="6"/>
<Button fx:id="browseKeystore" mnemonicParsing="false"
onAction="#showOpenKeystoreFileDialog" text="%Browse" GridPane.columnIndex="2"
GridPane.rowIndex="6"/>
<Label text="%Keystore password:" GridPane.rowIndex="7"/>
<PasswordField fx:id="passwordKeystore" GridPane.columnIndex="1" GridPane.rowIndex="7"/>
<Label text="%Server Timezone:" GridPane.rowIndex="8"/>
<TextField fx:id="serverTimezone" GridPane.columnIndex="1" GridPane.columnSpan="2"
GridPane.rowIndex="8"/>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
</rowConstraints>
</GridPane>
</children>
</GridPane>
</center>
</BorderPane>
</center>
<bottom>
<GridPane BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="20.0" prefWidth="120.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" />
<RowConstraints minHeight="10.0" prefHeight="30.0" />
<RowConstraints minHeight="10.0" prefHeight="30.0" />
<RowConstraints minHeight="10.0" prefHeight="30.0" />
<RowConstraints minHeight="10.0" prefHeight="30.0" />
<RowConstraints minHeight="10.0" prefHeight="30.0" />
<RowConstraints minHeight="10.0" prefHeight="30.0" />
<RowConstraints minHeight="10.0" prefHeight="30.0" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
</rowConstraints>
<children>
<Label text="%Database Type:" />
<ComboBox fx:id="databaseType" prefHeight="25.0" prefWidth="606.0" GridPane.columnIndex="1" GridPane.columnSpan="2" />
<Label text="%Host/Port:" GridPane.rowIndex="1" />
<TextField fx:id="host" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="database" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="2" />
<TextField fx:id="port" prefHeight="25.0" prefWidth="66.0" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Label text="%Database:" GridPane.rowIndex="2" />
<Label text="%User:" GridPane.rowIndex="3" />
<TextField fx:id="user" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="3" />
<Label text="%Password:" GridPane.rowIndex="4" />
<PasswordField fx:id="password" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="4" />
<CheckBox fx:id="rememberPassword" mnemonicParsing="false" text="%Remember Password" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="5" />
<CheckBox fx:id="useSSL" mnemonicParsing="false" text="%Use SSL" GridPane.rowIndex="5" />
<TextField fx:id="fileKeystore" GridPane.columnIndex="1" GridPane.rowIndex="6" />
<Button fx:id="browseKeystore" mnemonicParsing="false" onAction="#showOpenKeystoreFileDialog" text="%Browse" GridPane.columnIndex="2" GridPane.rowIndex="6" />
<Label text="%Server Timezone:" GridPane.rowIndex="8"/>
<TextField fx:id="serverTimezone" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="8" />
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
<PasswordField fx:id="passwordKeystore" GridPane.columnIndex="1" GridPane.rowIndex="7" />
<Label text="%Keystore:" GridPane.rowIndex="6" />
<Label text="%Keystore password:" GridPane.rowIndex="7" />
</children>
</GridPane>
</center>
</BorderPane>
</center>
<bottom>
<GridPane BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<CheckBox fx:id="autosave" mnemonicParsing="false" text="%Automatically save the library to" GridPane.columnSpan="2" />
<TextField fx:id="folder" GridPane.rowIndex="1" />
<Button fx:id="browseButton" mnemonicParsing="false" onAction="#showSaveDbToFileDialog" text="%Browse" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Group />
</children>
</GridPane>
</bottom>
</BorderPane>
</content>
<header>
</header>
<buttonTypes>
<ButtonType fx:constant="CLOSE" />
<ButtonType fx:id="connectButton" buttonData="OK_DONE" text="%Connect" />
</buttonTypes>
<children>
<CheckBox fx:id="autosave" mnemonicParsing="false" text="%Automatically save the library to"
GridPane.columnSpan="2"/>
<TextField fx:id="folder" GridPane.rowIndex="1"/>
<Button fx:id="browseButton" mnemonicParsing="false" onAction="#showSaveDbToFileDialog"
text="%Browse" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
<Group/>
</children>
</GridPane>
</bottom>
</BorderPane>
</content>
<header>
</header>
<buttonTypes>
<ButtonType fx:constant="CLOSE"/>
<ButtonType fx:id="connectButton" buttonData="OK_DONE" text="%Connect"/>
</buttonTypes>
</DialogPane>

0 comments on commit 29155ef

Please sign in to comment.