Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into bibdeskImport
Browse files Browse the repository at this point in the history
* upstream/main: (36 commits)
  chore: remove repetitive words (JabRef#11015)
  Fix test names (JabRef#11014)
  Remove obsolete "Comments" tab configuration (JabRef#11011)
  Fix "Other fields" tab respecting custom tabs (JabRef#11012)
  [WIP] Extract PDF References (JabRef#10437)
  Fixed jump to entry from crossref (JabRef#11009)
  fix suggestion provider for crossref field (JabRef#10962)
  Use SequencedSet for required and optional fields (JabRef#11007)
  Bump io.github.classgraph:classgraph from 4.8.165 to 4.8.168 (JabRef#11005)
  Bump org.glassfish.hk2:hk2-api from 3.0.6 to 3.1.0 (JabRef#11006)
  Bump org.apache.logging.log4j:log4j-to-slf4j from 2.23.0 to 2.23.1 (JabRef#11003)
  Bump org.javamodularity.moduleplugin from 1.8.14 to 1.8.15 (JabRef#11002)
  Bump jakarta.xml.bind:jakarta.xml.bind-api from 4.0.1 to 4.0.2 (JabRef#11004)
  Bump softprops/action-gh-release from 1 to 2 (JabRef#11000)
  Bump gittools/actions from 0.13.2 to 0.13.4 (JabRef#11001)
  Update custom-svg-icons.md (JabRef#10999)
  Update Texworks icon (JabRef#10998)
  Use tags editor for auto completion preferences (JabRef#10990)
  Enable auto merge of CHANGELOG.md (JabRef#10986)
  Enhance DOI parser to deal with special characters (JabRef#10989)
  ...

# Conflicts:
#	build.gradle
  • Loading branch information
Siedlerchr committed Mar 13, 2024
2 parents 0ec28ad + 45035df commit 8a4ec4e
Show file tree
Hide file tree
Showing 75 changed files with 1,683 additions and 214 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ gradlew text eol=lf
*.java text eol=lf
*.properties text eol=lf

# disable after a release (otherwise, duplicate CHANGELOG.md entries will be generated)
# CHANGELOG.md merge=union
CHANGELOG.md merge=union
4 changes: 2 additions & 2 deletions .github/workflows/deployment-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ jobs:
submodules: 'true'
show-progress: 'false'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.11.0
uses: gittools/actions/gitversion/setup@v0.13.4
with:
versionSpec: "5.x"
- name: Run GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.11.0
uses: gittools/actions/gitversion/execute@v0.13.4
- name: Setup JDK
uses: actions/setup-java@v4
with:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/deployment-jdk-ea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,17 @@ jobs:
show-progress: 'false'
- name: Install pigz and cache (linux)
if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'buildjet-4vcpu-ubuntu-2204-arm')
# 1.3.1 works, 1.4.1 does not (https://github.com/awalsh128/cache-apt-pkgs-action/issues/126)
uses: koppor/cache-apt-pkgs-action@add-arm64-support
uses: awalsh128/cache-apt-pkgs-action@master
with:
packages: pigz
version: 1.0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.11.0
uses: gittools/actions/gitversion/setup@v0.13.4
with:
versionSpec: "5.x"
- name: Run GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.11.0
uses: gittools/actions/gitversion/execute@v0.13.4
- name: 'Set up JDK ${{ matrix.jdk }}'
uses: oracle-actions/setup-java@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ jobs:
packages: pigz
version: 1.0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.11.0
uses: gittools/actions/gitversion/setup@v0.13.4
with:
versionSpec: "5.x"
- name: Run GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.11.0
uses: gittools/actions/gitversion/execute@v0.13.4
- name: Setup JDK
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
cd build
wget -q -m -r -nH --cut-dirs 2 --no-parent --accept=tar.gz,dmg,pkg,deb,rpm,zip,msi https://builds.jabref.org/tags/
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
draft: true
files: build/**
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Added

- We converted the "Custom API key" list to a table to be more accessible. [#10926](https://github.com/JabRef/jabref/issues/10926)
- We added a "refresh" button for the LaTeX citations tab in the entry editor. [#10584](https://github.com/JabRef/jabref/issues/10584)
- We added the possibility to show the BibTeX source in the [web search](https://docs.jabref.org/collect/import-using-online-bibliographic-database) import screen. [#560](https://github.com/koppor/jabref/issues/560)
- We added a fetcher for [ISIDORE](https://isidore.science/), simply paste in the link into the text field or the last 6 digits in the link that identify that paper. [#10423](https://github.com/JabRef/jabref/issues/10423)
Expand All @@ -25,6 +26,10 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We added the citation key pattern `[camelN]`. Equivalent to the first N words of the `[camel]` pattern.
- We added importing of static groups and linked files from BibDesk .bib files. [#10381](https://github.com/JabRef/jabref/issues/10381)
- We added ability to export in CFF (Citation File Format) [#10661](https://github.com/JabRef/jabref/issues/10661).
- We added ability to push entries to TeXworks. [#3197](https://github.com/JabRef/jabref/issues/3197)
- We added the ability to zoom in and out in the document viewer using <kbd>Ctrl</kbd> + <kbd>Scroll</kbd>. [#10964](https://github.com/JabRef/jabref/pull/10964)
- We added a Cleanup for removing non-existent files and grouped the related options [#10929](https://github.com/JabRef/jabref/issues/10929)
- We added the functionality to parse the bibliography of PDFs using the GROBID online service. [#10200](https://github.com/JabRef/jabref/issues/10200)

### Changed

Expand All @@ -39,6 +44,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We made the command "Push to TexShop" more robust to allow cite commands with a character before the first slash. [forum#2699](https://discourse.jabref.org/t/push-to-texshop-mac/2699/17?u=siedlerchr)
- We only show the notification "Saving library..." if the library contains more than 2000 entries. [#9803](https://github.com/JabRef/jabref/issues/9803)
- We enhanced the dialog for adding new fields in the content selector with a selection box containing a list of standard fields. [#10912](https://github.com/JabRef/jabref/pull/10912)
- We store the citation relations in an LRU cache to avoid bloating the memory and out-of-memory exceptions. [#10958](https://github.com/JabRef/jabref/issues/10958)
- Keywords filed are now displayed as tags. [#10910](https://github.com/JabRef/jabref/pull/10910)

### Fixed

Expand All @@ -47,6 +54,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where the preview panel showing the wrong entry (an entry that is not selected in the entry table). [#9172](https://github.com/JabRef/jabref/issues/9172)
- We fixed an issue where HTML-reserved characters like '&' and '<', in addition to HTML entities like '&amp;' were not rendered correctly in entry preview. [#10677](https://github.com/JabRef/jabref/issues/10677)
- The last page of a PDF is now indexed by the full text search. [#10193](https://github.com/JabRef/jabref/issues/10193)
- The entry editor respects the configured custom tabs when showing "Other fields". [#11012](https://github.com/JabRef/jabref/pull/11012)
- The default owner of an entry can be changed again. [#10924](https://github.com/JabRef/jabref/issues/10924)
- We fixed an issue where the duplicate check did not take umlauts or other LaTeX-encoded characters into account. [#10744](https://github.com/JabRef/jabref/pull/10744)
- We fixed the colors of the icon on hover for unset special fields. [#10431](https://github.com/JabRef/jabref/issues/10431)
Expand All @@ -55,6 +63,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where the `CommentsTab` was not properly formatted when the `defaultOwner` contained capital or special letters. [#10870](https://github.com/JabRef/jabref/issues/10870)
- We fixed an issue where the `File -> Close library` menu item was not disabled when no library was open. [#10948](https://github.com/JabRef/jabref/issues/10948)
- We fixed an issue where the Document Viewer would show the PDF in only half the window when maximized. [#10934](https://github.com/JabRef/jabref/issues/10934)
- Clicking on the crossref and related tags in the entry editor jumps to the linked entry. [#5484](https://github.com/JabRef/jabref/issues/5484) [#9369](https://github.com/JabRef/jabref/issues/9369)

### Removed

Expand Down
19 changes: 10 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {

id 'me.champeau.jmh' version '0.7.2'

id 'org.javamodularity.moduleplugin' version '1.8.13'
id 'org.javamodularity.moduleplugin' version '1.8.15'

id 'org.openjfx.javafxplugin' version '0.1.0'

Expand All @@ -27,7 +27,7 @@ plugins {

id 'idea'

id 'org.openrewrite.rewrite' version '6.8.2'
id 'org.openrewrite.rewrite' version '6.8.4'
}

// Enable following for debugging
Expand Down Expand Up @@ -177,7 +177,7 @@ dependencies {
implementation('com.tobiasdiez:easybind:2.2.1-SNAPSHOT')
implementation 'org.fxmisc.flowless:flowless:0.7.2'
implementation 'org.fxmisc.richtext:richtextfx:0.11.2'
implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '2.0.3') {
implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '2.2.0') {
exclude module: 'javax.inject' // Split package, use only jakarta.inject
exclude group: 'org.apache.logging.log4j'
}
Expand All @@ -196,14 +196,14 @@ dependencies {
// route all requests to java.util.logging to SLF4J (which in turn routes to tinylog)
implementation 'org.slf4j:jul-to-slf4j:2.0.9'
// route all requests to log4j to SLF4J
implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.23.0'
implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.23.1'

implementation('de.undercouch:citeproc-java:3.0.0-beta.2') {
exclude group: 'org.antlr'
}

// jakarta.activation is already dependency of glassfish
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '4.0.1'
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '4.0.2'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '4.0.3'

implementation ('com.github.tomtung:latex2unicode_2.13:0.3.2') {
Expand All @@ -228,7 +228,7 @@ dependencies {
implementation 'org.glassfish.jersey.core:jersey-server:3.1.5'
// injection framework
implementation 'org.glassfish.jersey.inject:jersey-hk2:3.1.5'
implementation 'org.glassfish.hk2:hk2-api:3.0.6'
implementation 'org.glassfish.hk2:hk2-api:3.1.0'
// testImplementation 'org.glassfish.hk2:hk2-testing:3.0.4'
// implementation 'org.glassfish.hk2:hk2-testing-jersey:3.0.4'
// testImplementation 'org.glassfish.hk2:hk2-junitrunner:3.0.4'
Expand All @@ -242,13 +242,14 @@ dependencies {
// Because of GraalVM quirks, we need to ship that. See https://github.com/jspecify/jspecify/issues/389#issuecomment-1661130973 for details
implementation 'org.jspecify:jspecify:0.3.0'

// parse plist files
implementation 'com.googlecode.plist:dd-plist:1.23'

testImplementation 'io.github.classgraph:classgraph:4.8.165'
testImplementation 'io.github.classgraph:classgraph:4.8.168'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
testImplementation 'org.junit.platform:junit-platform-launcher:1.10.2'

testImplementation 'org.mockito:mockito-core:5.10.0'
testImplementation 'org.mockito:mockito-core:5.11.0'
testImplementation 'org.xmlunit:xmlunit-core:2.9.1'
testImplementation 'org.xmlunit:xmlunit-matchers:2.9.1'
testRuntimeOnly 'com.tngtech.archunit:archunit-junit5-engine:1.2.1'
Expand All @@ -262,7 +263,7 @@ dependencies {
xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '3.0.2'
xjc group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '3.0.2'

rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.6.4"))
rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.7.1"))
rewrite("org.openrewrite.recipe:rewrite-static-analysis")
rewrite("org.openrewrite.recipe:rewrite-logging-frameworks")
rewrite("org.openrewrite.recipe:rewrite-testing-frameworks")
Expand Down
2 changes: 1 addition & 1 deletion config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Style-checks are done for each pull request and installing this code style confi
# Eclipse:

The Eclipse code formatter style is stored in the `eclipse.gradle` file and gets imported automatically.
In case the formatter style needs to be adapted, configure it and export in in eclipse.
In case the formatter style needs to be adapted, configure it and export in eclipse.

1. Right click on the eclipse project "JabRef"
2. Select "Export > General > Preferences"
Expand Down
9 changes: 8 additions & 1 deletion docs/code-howtos/custom-svg-icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ Good icon design requires years of experience and cannot be covered here. Adapti

## Step 2. Packing the icons into a font

Use the [IcoMoon](https://icomoon.io) tool for packing the icons. Create a new set and import _all_ icons. Rearrange them so that they have the same order as in `org.jabref.gui.JabRefMaterialDesignIcon`. This will avoid that you have to change the code points for the existing glyphs. In the settings for your icon set, set the _Grid_ to 24. This is important to get the correct spacing. The name of the font is `JabRefMaterialDesign`. When your icon-set is ready, select all of them and download the font-package.
Use the [IcoMoon](https://icomoon.io) tool for packing the icons.

1. Create a new set by importing the json file
2. Next to the icons, click on the hamburger menu, chose "Import to Set" to add a new icon (it will be added to the front)
Rearrange them so that they have the same order as in `org.jabref.gui.JabRefMaterialDesignIcon`. This will avoid that you have to change the code points for the existing glyphs. In the settings for your icon set, set the _Grid_ to 24. This is important to get the correct spacing. The name of the font is `JabRefMaterialDesign`.
3. Next to the icons, click on the hamburger menu and click "Select all".
4. Proceed with the font creating, set the font property name to `JabRefMaterialDesign`
When your icon-set is ready, select all of them and download the font-package.

## Step 3. Replace the existing `JabRefMaterialDesign.ttf`

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,11 @@ public void init() {
EasyBind.subscribe(tabbedPane.getSelectionModel().selectedItemProperty(), selectedTab -> {
if (selectedTab instanceof LibraryTab libraryTab) {
stateManager.setActiveDatabase(libraryTab.getBibDatabaseContext());
stateManager.activeTabProperty().set(Optional.of(libraryTab));
} else if (selectedTab == null) {
// All databases are closed
stateManager.setActiveDatabase(null);
stateManager.activeTabProperty().set(Optional.empty());
}
});

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ private void setDatabaseContext(BibDatabaseContext bibDatabaseContext) {
return;
}
if (tabPane.getSelectionModel().selectedItemProperty().get().equals(this)) {
LOGGER.debug("This case should not happen.");
LOGGER.warn("This case should not happen.");
stateManager.setActiveDatabase(bibDatabaseContext);
stateManager.activeTabProperty().set(Optional.of(this));
}

// Remove existing dummy BibDatabaseContext and add correct BibDatabaseContext from ParserResult to trigger changes in the openDatabases list in the stateManager
Expand Down Expand Up @@ -597,8 +598,8 @@ private void setupAutoCompletion() {
if (autoCompletePreferences.shouldAutoComplete()) {
suggestionProviders = new SuggestionProviders(getDatabase(), Globals.journalAbbreviationRepository, autoCompletePreferences);
} else {
// Create suggestion providers with database for crossref if auto-completion is deactivated
suggestionProviders = new SuggestionProviders(getDatabase());
// Create empty suggestion providers if auto-completion is deactivated
suggestionProviders = new SuggestionProviders();
}
searchAutoCompleter = new PersonNameSuggestionProvider(FieldFactory.getPersonNameFields(), getDatabase());
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/jabref/gui/StateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public class StateManager {
private final CustomLocalDragboard localDragboard = new CustomLocalDragboard();
private final ObservableList<BibDatabaseContext> openDatabases = FXCollections.observableArrayList();
private final OptionalObjectProperty<BibDatabaseContext> activeDatabase = OptionalObjectProperty.empty();
private final OptionalObjectProperty<LibraryTab> activeTab = OptionalObjectProperty.empty();
private final ReadOnlyListWrapper<GroupTreeNode> activeGroups = new ReadOnlyListWrapper<>(FXCollections.observableArrayList());
private final ObservableList<BibEntry> selectedEntries = FXCollections.observableArrayList();
private final ObservableMap<BibDatabaseContext, ObservableList<GroupTreeNode>> selectedGroups = FXCollections.observableHashMap();
Expand Down Expand Up @@ -91,6 +92,10 @@ public OptionalObjectProperty<BibDatabaseContext> activeDatabaseProperty() {
return activeDatabase;
}

public OptionalObjectProperty<LibraryTab> activeTabProperty() {
return activeTab;
}

public OptionalObjectProperty<SearchQuery> activeSearchQueryProperty() {
return activeSearchQuery;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/actions/StandardActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public enum StandardActions implements Action {
REBUILD_FULLTEXT_SEARCH_INDEX(Localization.lang("Rebuild fulltext search index"), IconTheme.JabRefIcons.FILE),
REDOWNLOAD_MISSING_FILES(Localization.lang("Redownload missing files"), IconTheme.JabRefIcons.DOWNLOAD),
OPEN_EXTERNAL_FILE(Localization.lang("Open file"), IconTheme.JabRefIcons.FILE, KeyBinding.OPEN_FILE),
EXTRACT_FILE_REFERENCES(Localization.lang("Extract references from file"), IconTheme.JabRefIcons.FILE_STAR),
OPEN_URL(Localization.lang("Open URL or DOI"), IconTheme.JabRefIcons.WWW, KeyBinding.OPEN_URL_OR_DOI),
SEARCH_SHORTSCIENCE(Localization.lang("Search ShortScience")),
MERGE_WITH_FETCHED_ENTRY(Localization.lang("Get bibliographic data from %0", "DOI/ISBN/...")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import javafx.collections.ObservableSet;

import org.jabref.model.entry.field.Field;
import org.jabref.model.entry.field.FieldFactory;

public class AutoCompletePreferences {

Expand Down Expand Up @@ -80,8 +79,4 @@ public void setNameFormat(NameFormat nameFormat) {
public ObservableSet<Field> getCompleteFields() {
return completeFields;
}

public String getCompleteNamesAsString() {
return FieldFactory.serializeFieldsList(completeFields);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.jabref.gui.autocompleter;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.stream.Stream;

Expand All @@ -26,7 +25,7 @@ public Stream<String> getSource() {
}

@Override
public Collection<String> getPossibleSuggestions() {
public List<String> getPossibleSuggestions() {
List<String> suggestions = new ArrayList<>();
if (suggestionProvider != null) {
suggestions.addAll(suggestionProvider.getPossibleSuggestions());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

Expand Down Expand Up @@ -60,7 +61,7 @@ public final Collection<T> provideSuggestions(ISuggestionRequest request) {

protected abstract Equivalence<T> getEquivalence();

public Collection<T> getPossibleSuggestions() {
public List<T> getPossibleSuggestions() {
Comparator<T> comparator = getComparator().reversed();
Equivalence<T> equivalence = getEquivalence();
return getSource().map(equivalence::wrap) // Need to do a bit of acrobatic as there is no distinctBy method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,12 @@ public SuggestionProviders(BibDatabase database, JournalAbbreviationRepository a
this.isEmpty = false;
}

public SuggestionProviders(BibDatabase database) {
this.database = database;
this.isEmpty = true;
}

public SuggestionProviders() {
this.isEmpty = true;
}

public SuggestionProvider<?> getForField(Field field) {
if (isEmpty || !autoCompletePreferences.getCompleteFields().contains(field)) {
Set<FieldProperty> fieldProperties = field.getProperties();
if (fieldProperties.contains(FieldProperty.SINGLE_ENTRY_LINK)) {
return new BibEntrySuggestionProvider(database);
}
return new EmptySuggestionProvider();
}

Expand Down
Loading

0 comments on commit 8a4ec4e

Please sign in to comment.