Skip to content
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
0bf92ca
Initial framework for jablib-examples
koppor Nov 3, 2025
95fea76
Rename "serializeAll" to "writeAll"
koppor Nov 3, 2025
0a00748
Add some `@NonNull` annotations
koppor Nov 3, 2025
57bb18d
Even more consistent
koppor Nov 3, 2025
16092ba
More renamings
koppor Nov 3, 2025
140e900
Add convenience constructor
koppor Nov 3, 2025
93db3a3
Add some nullable annotations
koppor Nov 3, 2025
54e426c
Add cross-links
koppor Nov 3, 2025
de0037d
Fix typo
koppor Nov 3, 2025
b18a5c8
Fix class name
koppor Nov 3, 2025
76d922a
Have BibliographyFromPdfImporter implementing PlainCitationParser
koppor Nov 3, 2025
8a3c91e
Add "IEEE" as another rule option
koppor Nov 3, 2025
17f6db1
Fix method name (and visibility)
koppor Nov 3, 2025
38a47a2
Compilefix
koppor Nov 3, 2025
68d3054
Fix casing in BibTeX
koppor Nov 3, 2025
130f47e
Enable LLM to be used to parse references
koppor Nov 3, 2025
0d1e03e
Refine code
koppor Nov 4, 2025
4e888bf
Move pdf related importers to pdf sub package
koppor Nov 4, 2025
7418e33
Initial PdfImporterWithPlainCitationParser
koppor Nov 5, 2025
2c62603
WIP: ieee_pdf_references_to_bibtex
koppor Nov 5, 2025
235b26e
Add link to CHANGELOG.md
koppor Nov 5, 2025
cfa1800
Refine PlainCitationParser interface
koppor Nov 5, 2025
a98cd82
Move methods to PdfUtils
koppor Nov 5, 2025
f4d8390
Make LlmPlainCitationParser a real importer
koppor Nov 5, 2025
7dc7437
Add missing class
koppor Nov 5, 2025
e8006eb
Wire all availble importers
koppor Nov 5, 2025
b983356
Rename BibliographyFromPdfImporter to RuleBasedBibliographyPdfImporter
koppor Nov 5, 2025
b1c6819
Introdue intermediate class BibliographyFromPdfImporter
koppor Nov 5, 2025
904e133
Fix PdfGrobitImporter (to really extract the references)
koppor Nov 5, 2025
a677807
Add comment
koppor Nov 5, 2025
235aafd
Fix JavaFX graphics dependency in ProgressCounter
Siedlerchr Nov 6, 2025
b5dbbe9
Merge branch 'main' into add-jablib-examples
koppor Nov 6, 2025
dd82a94
Remove routing method
koppor Nov 6, 2025
ad6b707
Remove obsolete test file
koppor Nov 6, 2025
f72cd28
Add development hint to README.md
koppor Nov 6, 2025
e9714df
First version of to BibTeX conversion
koppor Nov 6, 2025
392db23
Adapt test to new behavior
koppor Nov 6, 2025
b997fa0
Apply format
koppor Nov 6, 2025
bbc513c
Fix NullAway warning
koppor Nov 6, 2025
0e1fde8
Fix Moderinzer
koppor Nov 6, 2025
1786e0f
Refine checkstyle supressions
koppor Nov 6, 2025
e635b03
Fix typo
koppor Nov 6, 2025
a66d745
Use release version of action-checkstyle
koppor Nov 6, 2025
416fdb3
Move complete file ignores to checkstyle.xml
koppor Nov 6, 2025
be55865
Also run if jbang scripts themselves have changed
koppor Nov 6, 2025
9831ccb
Add link
koppor Nov 6, 2025
a8f62ab
Update checkstyle version in checkstyle-idea.xml
koppor Nov 6, 2025
75bfb4b
Remove obsolete comment
koppor Nov 6, 2025
7a73a8d
Apply suggestions from code review
koppor Nov 6, 2025
2f191e7
Merge branch 'add-jablib-examples' of github.com:JabRef/jabref into a…
koppor Nov 6, 2025
d096434
Merge branch 'main' into add-jablib-examples
koppor Nov 6, 2025
0f4811d
Fix checkstyle
koppor Nov 6, 2025
ce913f7
Increase IntelliJ version
koppor Nov 6, 2025
a387b22
Switch to other formatter
koppor Nov 6, 2025
25b9f9f
Fix checkstyle
koppor Nov 6, 2025
d19b49f
Fix reference
koppor Nov 6, 2025
7eb08b6
Apply renaming also in script
koppor Nov 6, 2025
2a3f386
Fix jbang build command (double .java)
koppor Nov 6, 2025
fc384e7
Workaround for formatter issue
koppor Nov 6, 2025
0560d81
Switch back to other formatter (better output)
koppor Nov 6, 2025
6daeb1d
Remove one more ".java"
koppor Nov 6, 2025
14a7739
Try to list all files
koppor Nov 6, 2025
fffd811
Rename "simple" to "general"
koppor Nov 6, 2025
3dc69f0
Debug: output modified files
koppor Nov 6, 2025
f03c2ac
Merge branch 'main' into add-jablib-examples
koppor Nov 6, 2025
b08b698
Add missing }
koppor Nov 6, 2025
d776868
Merge branch 'add-jablib-examples' of github.com:JabRef/jabref into a…
koppor Nov 6, 2025
a7a2c2c
Try other way for debugging
koppor Nov 6, 2025
eac8d1c
Ohter debug
koppor Nov 6, 2025
4d52e4a
Fix debug
koppor Nov 6, 2025
c8a3d1d
Fix copy and paste error
koppor Nov 6, 2025
8924cc8
Output script
koppor Nov 6, 2025
e45c33f
Remove obsolete ".java"
koppor Nov 6, 2025
1c71c91
Remove debug
koppor Nov 6, 2025
1e4f53f
Remove "build"
koppor Nov 6, 2025
b07b005
Fix source adaption
koppor Nov 6, 2025
ab342a9
Refine tests
koppor Nov 6, 2025
9c269a6
Better grouping
koppor Nov 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
upload-to-builds-jabref-org: ${{ steps.binary.outputs.upload-to-builds-jabref-org }}
secretspresent: ${{ steps.binary.outputs.secretspresent }}
tagbuild: ${{ steps.binary.outputs.tagbuild }}
# requried to avoid obsolete builds in case of labels != "dev: binaries"
# required to avoid obsolete builds in case of labels != "dev: binaries"
should-build: ${{ steps.binary.outputs.should-build }}
should-notarize: ${{ steps.binary.outputs.should-notarize }}

Expand Down
58 changes: 43 additions & 15 deletions .github/workflows/tests-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
distribution: 'corretto'
check-latest: true
- name: Run checkstyle reporter
uses: dbelyaev/action-checkstyle@master
uses: dbelyaev/action-checkstyle@v3
with:
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: koppor/intellij-idea-format@update-to-latest-intellij
- uses: leventeBajczi/intellij-idea-format@master
with:
file-mask: "*.java"
settings-file: ".idea/codeStyles/Project.xml"
Expand Down Expand Up @@ -438,13 +438,25 @@ jobs:
with:
submodules: 'false'
show-progress: 'false'
- name: Detect changed jablib classes
id: changed-jablib-files
uses: tj-actions/changed-files@v47
with:
files: |
.jbang/*.java
jablib/src/main/java/**/*.java
jablib-examples/**/*.java
files_ignore: |
jablib/src/main/java/**/*-*.java
- name: Set up JDK
if: steps.changed-jablib-files.outputs.any_changed != 'true'
uses: actions/setup-java@v5
with:
java-version: 24
distribution: 'corretto'
check-latest: true
- name: Generate JBang cache key
if: steps.changed-jablib-files.outputs.any_changed != 'true'
id: cache-key
shell: bash
run: |
Expand All @@ -457,15 +469,26 @@ jobs:
restore-keys:
jbang-
- name: Setup JBang
if: steps.changed-jablib-files.outputs.any_changed != 'true'
uses: jbangdev/setup-jbang@main
- run: jbang build .jbang/CheckoutPR.java
if: steps.changed-jablib-files.outputs.any_changed != 'true'
- run: jbang build .jbang/CloneJabRef.java
if: steps.changed-jablib-files.outputs.any_changed != 'true'
- run: jbang build --fresh .jbang/JabKitLauncher.java
if: steps.changed-jablib-files.outputs.any_changed != 'true'
- run: jbang build --fresh .jbang/JabLsLauncher.java
if: steps.changed-jablib-files.outputs.any_changed != 'true'
- run: jbang build --fresh .jbang/JabSrvLauncher.java
if: steps.changed-jablib-files.outputs.any_changed != 'true'
- run: jbang build --fresh jablib-examples/*.java
if: steps.changed-jablib-files.outputs.any_changed != 'true'
- run: jbang run .jbang/JabKitLauncher.java --help
if: steps.changed-jablib-files.outputs.any_changed != 'true'
- run: jbang run .jbang/JabLsLauncher.java --help
if: steps.changed-jablib-files.outputs.any_changed != 'true'
- run: jbang run .jbang/JabSrvLauncher.java --help
if: steps.changed-jablib-files.outputs.any_changed != 'true'

jbang-pr:
name: JBang (PR)
Expand All @@ -475,13 +498,26 @@ jobs:
strategy:
fail-fast: false
matrix:
launcher: [JabKitLauncher, JabLsLauncher, JabSrvLauncher]
script: [.jbang/JabKitLauncher.java, .jbang/JabLsLauncher.java, .jbang/JabSrvLauncher.java, jablib-examples/ieee_pdf_references_to_bibtex.java]
steps:
- name: Checkout source
uses: actions/checkout@v5
with:
submodules: 'false'
show-progress: 'false'
- name: Detect changed jablib classes
id: changed-jablib-files
uses: tj-actions/changed-files@v47
with:
files: |
.jbang/*.java
jablib/src/main/java/**/*.java
jablib-examples/**/*.java
files_ignore: |
jablib/src/main/java/**/*-*.java
base_sha: ${{ github.event.pull_request.base.sha }
write_output_files: true
- run: cat .github/outputs/*.txt
- name: Set up JDK
uses: actions/setup-java@v5
with:
Expand All @@ -502,24 +538,16 @@ jobs:
jbang-
- name: Setup JBang
uses: jbangdev/setup-jbang@main
- name: Detect changed jablib classes
id: changed-jablib-files
uses: tj-actions/changed-files@v47
with:
files: |
jablib/src/main/java/**/*.java
files_ignore: |
jablib/src/main/java/**/*-*.java
- name: Build ${{ matrix.launcher }} launcher including changed classes
- name: Build ${{ matrix.script }} including changed classes
shell: bash
# We always run, because changes in jabls, jabsrv also could cause JBang to fail
run: |
# We modify the JBang scripts directly to avoid issues with relative paths
for f in ${{ steps.changed-jablib-files.outputs.all_changed_files }}; do
echo "//SOURCES ../$f" >> ".jbang/${{ matrix.launcher }}.java"
echo "//SOURCES ../$f" >> "${{ matrix.script }}.java"
done
jbang build --fresh ".jbang/${{ matrix.launcher }}.java"
- run: jbang ".jbang/${{ matrix.launcher }}.java" --help
jbang build --fresh "${{ matrix.script }}"
- run: jbang "${{ matrix.script }}" --help
shell: bash

codecoverage:
Expand Down
2 changes: 1 addition & 1 deletion .idea/checkstyle-idea.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 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 added "IEEE" as another option for parsing plain text citations. [#14233](github.com/JabRef/jabref/pull/14233)
- We added automatic date-based groups that create year/month/day subgroups from an entry’s date fields. [#10822](https://github.com/JabRef/jabref/issues/10822)

### Changed
Expand Down
30 changes: 26 additions & 4 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,38 @@
<module name="Checker">
<property name="charset" value="UTF-8"/>

<module name="Header">
<property name="header" value=""/>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]\.idea[/\\]" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]\.jbang[/\\]" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]build-support[/\\]" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]generated(-sources|-src)?[/\\]" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]jablib-examples[/\\]" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]src-gen[/\\]" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<!-- We ignore this file because it's a modification of the original java code https://github.com/openjdk/jfx/blob/jfx15/modules/javafx.controls/src/main/java/javafx/scene/control/skin/TitledPaneSkin.java -->
<property name="fileNamePattern" value="CustomTitledPaneSkin\.java$" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>

<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>

<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
<module name="Header">
<property name="header" value=""/>
</module>

<module name="FileTabCharacter"/>
Expand Down
32 changes: 27 additions & 5 deletions config/checkstyle/checkstyle_reviewdog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,38 @@
<module name="Checker">
<property name="charset" value="UTF-8"/>

<module name="Header">
<property name="header" value=""/>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]\.idea[/\\]" />
</module>

<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]\.jbang[/\\]" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]build-support[/\\]" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]generated(-sources|-src)?[/\\]" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]jablib-examples[/\\]" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="[/\\]src-gen[/\\]" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<!-- We ignore this file because it's a modification of the original java code https://github.com/openjdk/jfx/blob/jfx15/modules/javafx.controls/src/main/java/javafx/scene/control/skin/TitledPaneSkin.java -->
<property name="fileNamePattern" value="CustomTitledPaneSkin\.java$" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="(module\-info|heylogs)\.java$"/>
</module>

<module name="SuppressionFilter">
<property name="file" value="config/checkstyle/suppressions.xml"/>
</module>

<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="(module\-info|heylogs)\.java$"/>
<module name="Header">
<property name="header" value=""/>
</module>

<module name="FileTabCharacter"/>
Expand Down
9 changes: 0 additions & 9 deletions config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@
"http://www.checkstyle.org/dtds/suppressions_1_1.dtd">

<suppressions>
<suppress checks="[a-zA-Z0-9]*" files="[\\/].jbang[\\/]" />
<suppress checks="[a-zA-Z0-9]*" files="[\\/]build-support[\\/]" />
<suppress checks="[a-zA-Z0-9]*" files="[\\/]generated[\\/]" />
<suppress checks="[a-zA-Z0-9]*" files="[\\/]generated-sources[\\/]" />
<suppress checks="[a-zA-Z0-9]*" files="[\\/]generated-src[\\/]" />
<suppress checks="[a-zA-Z0-9]*" files="[\\/]src-gen[\\/]" />
<suppress checks="[a-zA-Z0-9]*" files="[\\/].idea[\\/]" />
<!-- We ignore this file because it's a modification of the original java code https://github.com/openjdk/jfx/blob/jfx15/modules/javafx.controls/src/main/java/javafx/scene/control/skin/TitledPaneSkin.java -->
<suppress checks="[a-zA-Z0-9]*" files="CustomTitledPaneSkin.java" />
<!-- Following contain examples or comments with "}}" that are necessary -->
<suppress id="NoMultipleClosingBracesAtEndOfLine" files="(BibtexParserTest|StringUtil).java" />
</suppressions>
2 changes: 1 addition & 1 deletion jabgui/src/main/java/org/jabref/gui/ClipBoardManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,6 @@ private String serializeEntries(List<BibEntry> entries, BibEntryTypesManager ent
// At reading of the clipboard in JabRef, we parse the plain string in all cases, so we don't need to flag we put BibEntries here
// Furthermore, storing a string also enables other applications to work with the data
BibEntryWriter writer = new BibEntryWriter(new FieldWriter(preferences.getFieldPreferences()), entryTypesManager);
return writer.serializeAll(entries, BibDatabaseMode.BIBTEX);
return writer.write(entries, BibDatabaseMode.BIBTEX);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ void performBackup(Path backupPath) {
preferences.getCitationKeyPatternPreferences(),
entryTypesManager)
// we save the clone to prevent the original database (and thus the UI) from being changed
.saveDatabase(bibDatabaseContextClone);
.writeDatabase(bibDatabaseContextClone);
backupFilesQueue.add(backupPath);

// We wrote the file successfully
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import org.jabref.logic.help.HelpFile;
import org.jabref.logic.importer.EntryBasedFetcher;
import org.jabref.logic.importer.WebFetchers;
import org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter;
import org.jabref.logic.importer.fileformat.pdf.PdfMergeMetadataImporter;
import org.jabref.logic.journals.JournalAbbreviationRepository;
import org.jabref.logic.util.BuildInfo;
import org.jabref.logic.util.TaskExecutor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ private boolean saveDatabase(Path file, boolean selectedOnly, Charset encoding,
entryTypesManager);

if (selectedOnly) {
databaseWriter.savePartOfDatabase(bibDatabaseContext, libraryTab.getSelectedEntries());
databaseWriter.writePartOfDatabase(bibDatabaseContext, libraryTab.getSelectedEntries());
} else {
databaseWriter.saveDatabase(bibDatabaseContext);
databaseWriter.writeDatabase(bibDatabaseContext);
}

libraryTab.registerUndoableChanges(databaseWriter.getSaveActionsFieldChanges());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import org.jabref.logic.importer.ParseException;
import org.jabref.logic.importer.ParserResult;
import org.jabref.logic.importer.fileformat.BibtexParser;
import org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter;
import org.jabref.logic.importer.fileformat.pdf.PdfMergeMetadataImporter;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.net.URLDownload;
import org.jabref.logic.util.BackgroundTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import org.jabref.logic.importer.ImportFormatReader;
import org.jabref.logic.importer.Importer;
import org.jabref.logic.importer.ParserResult;
import org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter;
import org.jabref.logic.importer.fileformat.pdf.PdfGrobidImporter;
import org.jabref.logic.importer.fileformat.pdf.PdfMergeMetadataImporter;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.preferences.CliPreferences;
import org.jabref.logic.util.BackgroundTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.jabref.gui.actions.SimpleCommand;
import org.jabref.gui.importer.ImportEntriesDialog;
import org.jabref.logic.importer.ParserResult;
import org.jabref.logic.importer.fileformat.BibliographyFromPdfImporter;
import org.jabref.logic.importer.fileformat.pdf.RuleBasedBibliographyPdfImporter;
import org.jabref.logic.importer.util.GrobidService;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.preferences.CliPreferences;
Expand Down Expand Up @@ -48,7 +48,7 @@ public class ExtractReferencesAction extends SimpleCommand {
private final BibEntry entry;
private final LinkedFile linkedFile;

private final BibliographyFromPdfImporter bibliographyFromPdfImporter;
private final RuleBasedBibliographyPdfImporter ruleBasedBibliographyPdfImporter;

public ExtractReferencesAction(DialogService dialogService,
StateManager stateManager,
Expand All @@ -72,7 +72,7 @@ private ExtractReferencesAction(@NonNull DialogService dialogService,
this.preferences = preferences;
this.entry = entry;
this.linkedFile = linkedFile;
bibliographyFromPdfImporter = new BibliographyFromPdfImporter(preferences.getCitationKeyPatternPreferences());
ruleBasedBibliographyPdfImporter = new RuleBasedBibliographyPdfImporter(preferences.getCitationKeyPatternPreferences());

if (this.linkedFile == null) {
this.executable.bind(
Expand Down Expand Up @@ -132,7 +132,7 @@ private void extractReferences() {
List<Path> fileList = FileUtil.getListOfLinkedFiles(selectedEntries, databaseContext.getFileDirectories(preferences.getFilePreferences()));

// We need to have ParserResult handled at the importer, because it imports the meta data (library type, encoding, ...)
ParserResult result = bibliographyFromPdfImporter.importDatabase(fileList.getFirst());
ParserResult result = ruleBasedBibliographyPdfImporter.importDatabase(fileList.getFirst());

// subsequent files are just appended to result
Iterator<Path> fileListIterator = fileList.iterator();
Expand All @@ -155,7 +155,7 @@ private void extractReferences() {

private void extractReferences(Iterator<Path> fileListIterator, ParserResult result, BibEntry currentEntry) {
while (fileListIterator.hasNext()) {
result.getDatabase().insertEntries(bibliographyFromPdfImporter.importDatabase(fileListIterator.next()).getDatabase().getEntries());
result.getDatabase().insertEntries(ruleBasedBibliographyPdfImporter.importDatabase(fileListIterator.next()).getDatabase().getEntries());
}

String cites = getCites(result.getDatabase().getEntries(), currentEntry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
import org.jabref.gui.LibraryTabContainer;
import org.jabref.gui.StateManager;
import org.jabref.logic.importer.ParserResult;
import org.jabref.logic.importer.fileformat.BibliographyFromPdfImporter;
import org.jabref.logic.importer.fileformat.pdf.RuleBasedBibliographyPdfImporter;
import org.jabref.logic.preferences.CliPreferences;
import org.jabref.logic.util.TaskExecutor;

public class NewLibraryFromPdfActionOffline extends NewLibraryFromPdfAction {

private final BibliographyFromPdfImporter bibliographyFromPdfImporter;
private final RuleBasedBibliographyPdfImporter ruleBasedBibliographyPdfImporter;

public NewLibraryFromPdfActionOffline(LibraryTabContainer libraryTabContainer, StateManager stateManager, DialogService dialogService, CliPreferences preferences, TaskExecutor taskExecutor) {
super(libraryTabContainer, stateManager, dialogService, preferences, taskExecutor);

// Use the importer keeping the numbers (instead of generating keys; which is the other constructor)
this.bibliographyFromPdfImporter = new BibliographyFromPdfImporter();
this.ruleBasedBibliographyPdfImporter = new RuleBasedBibliographyPdfImporter();
}

@Override
protected Callable<ParserResult> getParserResultCallable(Path path) {
return () -> bibliographyFromPdfImporter.importDatabase(path);
return () -> ruleBasedBibliographyPdfImporter.importDatabase(path);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ private void initializeInterpretCitations() {
interpretParser.valueProperty().bindBidirectional(viewModel.interpretParserProperty());
PlainCitationParserChoice initialParser = parserFromName(preferences.getLatestInterpretParser(), interpretParser.getItems());
if (initialParser == null) {
final PlainCitationParserChoice defaultParser = PlainCitationParserChoice.RULE_BASED;
final PlainCitationParserChoice defaultParser = PlainCitationParserChoice.RULE_BASED_GENERAL;
initialParser = parserFromName(defaultParser.getLocalizedName(), interpretParser.getItems());
}
interpretParser.setValue(initialParser);
Expand Down
Loading
Loading