-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add per library journal abbreviation type (LTWA) on save #15517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
faneeshh
wants to merge
11
commits into
JabRef:main
Choose a base branch
from
faneeshh:fix-15495
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9243759
added libraryAbbrevationtype to metadata
faneeshh dd2296e
add metadata seralization
faneeshh 1133b54
wire abbreviationJournalcleanup into savadatabaseaction on save
faneeshh d3cb9a5
add journal abbreviation preference to library properties
faneeshh 1163656
added tests for libraryAbbreviationtype round trip and LTWA cleanup o…
faneeshh 753c5a3
merged two split tests into a single one
faneeshh 8096dc9
Changelog entry
faneeshh a4338cf
Merge branch 'main' into fix-15495
faneeshh a410c82
Merge branch 'main' into fix-15495
faneeshh 835af3f
fixed abbreviation running after write and ighnoring selectedScope only
faneeshh 031b19d
Changelog fix
faneeshh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,16 @@ | ||
| package org.jabref.gui.libraryproperties.saving; | ||
|
|
||
| import javafx.collections.FXCollections; | ||
| import javafx.fxml.FXML; | ||
| import javafx.scene.control.CheckBox; | ||
| import javafx.scene.control.ComboBox; | ||
| import javafx.util.StringConverter; | ||
|
|
||
| import org.jabref.gui.commonfxcontrols.FieldFormatterCleanupsPanel; | ||
| import org.jabref.gui.commonfxcontrols.SaveOrderConfigPanel; | ||
| import org.jabref.gui.libraryproperties.AbstractPropertiesTabView; | ||
| import org.jabref.gui.libraryproperties.PropertiesTab; | ||
| import org.jabref.logic.journals.AbbreviationType; | ||
| import org.jabref.logic.l10n.Localization; | ||
| import org.jabref.logic.preferences.CliPreferences; | ||
| import org.jabref.model.database.BibDatabaseContext; | ||
|
|
@@ -19,6 +23,7 @@ public class SavingPropertiesView extends AbstractPropertiesTabView<SavingProper | |
| @FXML private CheckBox protect; | ||
| @FXML private SaveOrderConfigPanel saveOrderConfigPanel; | ||
| @FXML private FieldFormatterCleanupsPanel fieldFormatterCleanupsPanel; | ||
| @FXML private ComboBox<AbbreviationType> journalAbbreviationOnSave; | ||
|
|
||
| @Inject private CliPreferences preferences; | ||
|
|
||
|
|
@@ -49,5 +54,33 @@ public void initialize() { | |
|
|
||
| fieldFormatterCleanupsPanel.cleanupsDisableProperty().bindBidirectional(viewModel.cleanupsDisableProperty()); | ||
| fieldFormatterCleanupsPanel.cleanupsProperty().bindBidirectional(viewModel.cleanupsProperty()); | ||
|
|
||
| journalAbbreviationOnSave.setItems(FXCollections.observableArrayList( | ||
| null, AbbreviationType.DEFAULT, AbbreviationType.DOTLESS, | ||
| AbbreviationType.SHORTEST_UNIQUE, AbbreviationType.LTWA)); | ||
| journalAbbreviationOnSave.setConverter(new StringConverter<>() { | ||
| @Override | ||
| public String toString(AbbreviationType type) { | ||
| if (type == null) { | ||
| return Localization.lang("None (use global setting)"); | ||
| } | ||
| return switch (type) { | ||
| case DEFAULT -> | ||
| Localization.lang("Abbreviate (default)"); | ||
| case DOTLESS -> | ||
| Localization.lang("Abbreviate (dotless)"); | ||
| case SHORTEST_UNIQUE -> | ||
| Localization.lang("Abbreviate (shortest unique)"); | ||
| case LTWA -> | ||
| Localization.lang("Abbreviate (LTWA)"); | ||
| }; | ||
| } | ||
|
Comment on lines
+67
to
+77
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hope these options sound correct. |
||
|
|
||
| @Override | ||
| public AbbreviationType fromString(String string) { | ||
| return null; | ||
| } | ||
| }); | ||
| journalAbbreviationOnSave.valueProperty().bindBidirectional(viewModel.journalAbbreviationOnSaveProperty()); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Cleanup logic added to gui
📘 Rule violation⚙ MaintainabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools