-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Save deletion of current searchquery #2469
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,7 +207,8 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe | |
|
||
private ContentAutoCompleters autoCompleters; | ||
|
||
private SearchQuery currentSearchQuery; | ||
/** the query the user searches when this basepanel is active */ | ||
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. Please use 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. JavaDoc works on properties too (I think you overlooked the second asterisks). |
||
private Optional<SearchQuery> currentSearchQuery = Optional.empty(); | ||
|
||
|
||
public BasePanel(JabRefFrame frame, BibDatabaseContext bibDatabaseContext) { | ||
|
@@ -2405,12 +2406,20 @@ public BibDatabaseContext getDatabaseContext() { | |
return bibDatabaseContext; | ||
} | ||
|
||
public SearchQuery getCurrentSearchQuery() { | ||
public Optional<SearchQuery> getCurrentSearchQuery() { | ||
return currentSearchQuery; | ||
} | ||
|
||
/** | ||
* Set the query the user currently searches while this basepanel is active | ||
* @param currentSearchQuery can be null | ||
*/ | ||
public void setCurrentSearchQuery(SearchQuery currentSearchQuery) { | ||
this.currentSearchQuery = currentSearchQuery; | ||
if (currentSearchQuery == null) { | ||
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. You can use 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. However, I am unsure whether 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. done |
||
this.currentSearchQuery = Optional.empty(); | ||
} else { | ||
this.currentSearchQuery = Optional.of(currentSearchQuery); | ||
} | ||
} | ||
|
||
public CitationStyleCache getCitationStyleCache() { | ||
|
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 would use (a slight update of) your long sentence of the PR text here - and put the "Fixes" as last (as with the other entries)
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