-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Added "Add example entry" and "Import existing PDFs" when a library is empty #12741
base: main
Are you sure you want to change the base?
Conversation
-Ensures button is hidden when entries exist but are filtered -Add listeners to track database and table entry changes
-used localization -added styles for button
…e-12662 # Conflicts: # src/main/java/org/jabref/gui/maintable/MainTable.java
-checks if directory exists -triggers search for unlinked files ( if directory exists ) -Shows notification and open library properties ( if directory doesn't exist)
dialogService.showWarningDialogAndWait( | ||
Localization.lang("File directory is not set or does not exist!"), |
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.
Used Key which was already defined in properties , Should i update ?
…e-12662 # Conflicts: # src/main/java/org/jabref/gui/Base.css
dialogService.showWarningDialogAndWait( | ||
Localization.lang("File directory is not set or does not exist!"), |
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.
Yes, but please think whether it could be critical error, then leave the !
.
- Removed Unnecessary comments - Used withField for BibEntry instead of setField
-updating with period
Hey , Could you please explain in detail about the global prefs checks . Thanks |
Please. Think of a user perspective. Read on at https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#directories-for-files, then my specification makes sense?! |
With
That wish should be fulfilled... Hopefully. Please check |
Yes, I’m checking this condition:
Just to confirm inside the else block, I should also check the global preferences, right? |
libraryTab.showAndEdit(entry); | ||
}); | ||
|
||
Button importPdfsButton = new Button(Localization.lang("Import existing PDFs")); |
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.
// TODO: activate only if directories available
// enable if !databaseContext.getFileDirectories(filePreferences).isEmpty()
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.
Add hover if disabled: "Please configure a file directory"
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.
with respect to initial issue - Show a notification that no directory exist and then open the library properties.
what about open library properties ? are we doing that ?
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.
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.
Done
dialogService.showWarningDialogAndWait( | ||
Localization.lang("File directory is not set or does not exist."), | ||
Localization.lang("Please configure a file directory")); | ||
|
||
LibraryPropertiesAction libraryPropertiesAction = new LibraryPropertiesAction(stateManager); | ||
libraryPropertiesAction.execute(); |
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.
Should never happen
-Added focus for library-specific file directory
-Removed Unused Localization keys -Updated to lambda for better readability
|
||
updatePlaceholder(placeholderBox); | ||
|
||
database.getDatabase().getEntries().addListener((ListChangeListener<BibEntry>) change -> updatePlaceholder(placeholderBox)); |
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.
Does following work, too? - I don't see any usage of the variable.
database.getDatabase().getEntries().addListener((ListChangeListener<BibEntry>) change -> updatePlaceholder(placeholderBox)); | |
database.getDatabase().getEntries().addListener(_ -> updatePlaceholder(placeholderBox)); |
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.
I'm sticking with the original code since the lambda with an underscore parameter creates ambiguity error.
|
||
database.getDatabase().getEntries().addListener((ListChangeListener<BibEntry>) change -> updatePlaceholder(placeholderBox)); | ||
|
||
this.getItems().addListener((ListChangeListener<BibEntryTableViewModel>) change -> updatePlaceholder(placeholderBox)); |
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.
this.getItems().addListener((ListChangeListener<BibEntryTableViewModel>) change -> updatePlaceholder(placeholderBox)); | |
this.getItems().addListener(_ -> updatePlaceholder(placeholderBox)); |
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.
I'm sticking with the original code since the lambda with an underscore parameter creates ambiguity error.
BibEntry exampleEntry = new BibEntry(StandardEntryType.Article); | ||
exampleEntry.withField(StandardField.AUTHOR, "Oliver Kopp and Carl Christian Snethlage and Christoph Schwentker"); | ||
exampleEntry.withField(StandardField.TITLE, "JabRef: BibTeX-based literature management software"); | ||
exampleEntry.withField(StandardField.JOURNAL, "TUGboat"); | ||
exampleEntry.withField(StandardField.VOLUME, "44"); | ||
exampleEntry.withField(StandardField.NUMBER, "3"); | ||
exampleEntry.withField(StandardField.PAGES, "441--447"); | ||
exampleEntry.withField(StandardField.DOI, "10.47397/tb/44-3/tb138kopp-jabref"); | ||
exampleEntry.withField(StandardField.ISSN, "0896-3207"); | ||
exampleEntry.withField(StandardField.ISSUE, "138"); | ||
exampleEntry.withField(StandardField.YEAR, "2023"); |
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.
Chain these statemetns
BibEntry exampleEntry = new BibEntry(StandardEntryType.Article); | |
exampleEntry.withField(StandardField.AUTHOR, "Oliver Kopp and Carl Christian Snethlage and Christoph Schwentker"); | |
exampleEntry.withField(StandardField.TITLE, "JabRef: BibTeX-based literature management software"); | |
exampleEntry.withField(StandardField.JOURNAL, "TUGboat"); | |
exampleEntry.withField(StandardField.VOLUME, "44"); | |
exampleEntry.withField(StandardField.NUMBER, "3"); | |
exampleEntry.withField(StandardField.PAGES, "441--447"); | |
exampleEntry.withField(StandardField.DOI, "10.47397/tb/44-3/tb138kopp-jabref"); | |
exampleEntry.withField(StandardField.ISSN, "0896-3207"); | |
exampleEntry.withField(StandardField.ISSUE, "138"); | |
exampleEntry.withField(StandardField.YEAR, "2023"); | |
BibEntry exampleEntry = new BibEntry(StandardEntryType.Article) | |
.withField(StandardField.AUTHOR, "Oliver Kopp and Carl Christian Snethlage and Christoph Schwentker") | |
.withField(StandardField.TITLE, "JabRef: BibTeX-based literature management software") | |
.withField(StandardField.JOURNAL, "TUGboat") | |
.withField(StandardField.VOLUME, "44") | |
.withField(StandardField.NUMBER, "3") | |
.withField(StandardField.PAGES, "441--447") | |
.withField(StandardField.DOI, "10.47397/tb/44-3/tb138kopp-jabref") | |
.withField(StandardField.ISSN, "0896-3207") | |
.withField(StandardField.ISSUE, "138") | |
.withField(StandardField.YEAR, "2023"); |
FindUnlinkedFilesAction findUnlinkedFilesAction = new FindUnlinkedFilesAction(dialogService, stateManager); | ||
findUnlinkedFilesAction.execute(); |
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.
Indent is off
|
||
|
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.
Remove empty lines at end
-Label Style Changes
…into fix-issue-12662
@trag-bot didn't find any issues in the code! ✅✨ |
Closes #12662
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)