Refactor EntryEditorPreferences#6245
Conversation
… extracted store logic out of dialog CustomizeGeneralFieldsDialogViewModel.
…torprefs # Conflicts: # src/main/java/org/jabref/preferences/JabRefPreferences.java # src/main/java/org/jabref/preferences/PreferencesService.java
|
I think I'll stop here, as this PR is already large enough. There is theoretically plenty left to do with the EntryEditorPreferences. I'm thinking of merging the CustomizeGenerealFields dialog into the preferences, splitting some preferences into subtabs... However, lets talk about this one. |
|
This PR does only extract the calls to |
…torprefs # Conflicts: # src/main/java/org/jabref/gui/customizefields/CustomizeGeneralFieldsDialogViewModel.java # src/main/java/org/jabref/gui/preferences/EntryEditorTabViewModel.java # src/main/java/org/jabref/preferences/JabRefPreferences.java
tobiasdiez
left a comment
There was a problem hiding this comment.
Mostly looks good to me. Good job! Just some minor comments.
|
|
||
| public class BibtexKeyEditorViewModel extends AbstractEditorViewModel { | ||
| private final EntryEditorPreferences preferences; | ||
| private final PreferencesService preferencesService; |
There was a problem hiding this comment.
In my opinion, the name preferences is also fine. That's probably a matter of taste...
There was a problem hiding this comment.
In the process of moving from JabRefPreferences to PreferencesService (and preferences objects) I wanted to distinguish between JabRefPreferences as preferences or prefs or whatever is used in the code on one hand and preferencesService on the other.
But we can change that after I'm hopefully done sometime.
| autoCompleteFieldsProperty.setValue(autoCompletePreferences.getCompleteNamesAsString()); | ||
|
|
||
| if (autoCompletePreferences.getOnlyCompleteFirstLast()) { | ||
| // ToDo: Include EntryEditorFieldsEditor in PreferencesDialog |
There was a problem hiding this comment.
Is this todo still relevant?
There was a problem hiding this comment.
Had the wrong name. Should be CustomizeGeneralFieldsDialog
| } else { | ||
| autoCompletePreferences.setOnlyCompleteFirstLast(false); | ||
| autoCompletePreferences.setOnlyCompleteLastFirst(true); | ||
| preferencesService.storeEntryEditorPreferences(new EntryEditorPreferences( |
There was a problem hiding this comment.
Can these constants JabRefPreferences.AUTO_OPEN_FORM etc now be made private?
There was a problem hiding this comment.
Sadly no, not yet, since they are still in use outside the preferences dialog. I did not yet remove all the calls to JabRefPreferences::get and ::put in the whole codebase, since this would make this PR completly unreviewable.
I wanted to do this step by step.
…torprefs # Conflicts: # src/main/java/org/jabref/gui/fieldeditors/BibtexKeyEditorViewModel.java
# By Tobias Diez (10) and others # Via dimitra-karadima (5) and others * upstream/master: (62 commits) Backward compatibility for 4.3.1 (#6296) Fix Export to clipboard Dialog icon (#6345) Refactor EntryEditorPreferences (#6245) Update label names Squashed 'src/main/resources/csl-locales/' changes from d0ee4d13c9..79845b087b Squashed 'src/main/resources/csl-styles/' changes from c1793d2..143464e Cite work by @ayaankazerouni Improve performance for loading files (#6332) Add ADR von JUnit vs. AssertJ (#6335) 'Name' textfield on focus instead of 'OK' button when user clicks on 'Add subgroup' option (#6330) Bump jurt from 6.3.2 to 6.4.3 (#6325) Bump unoil from 6.3.2 to 6.4.3 (#6320) Bump ridl from 6.3.2 to 6.4.3 (#6326) Bump classgraph from 4.8.69 to 4.8.71 (#6322) Bump flexmark from 0.61.6 to 0.61.16 (#6318) Bump richtextfx from 0.10.4 to 0.10.5 (#6319) Bump guava from 28.2-jre to 29.0-jre (#6323) Bump flexmark-ext-gfm-tasklist from 0.61.6 to 0.61.16 (#6327) Bump org.beryx.jlink from 2.17.5 to 2.17.7 (#6324) Improve performance massively by fixing a stupid binding mistake (#6316) ... # Conflicts: # build.gradle
…ionCaseInsensitive * upstream/master: (32 commits) Fix Export to clipboard Dialog icon (#6345) Refactor EntryEditorPreferences (#6245) Update label names Squashed 'src/main/resources/csl-locales/' changes from d0ee4d13c9..79845b087b Squashed 'src/main/resources/csl-styles/' changes from c1793d2..143464e Cite work by @ayaankazerouni Improve performance for loading files (#6332) Add ADR von JUnit vs. AssertJ (#6335) 'Name' textfield on focus instead of 'OK' button when user clicks on 'Add subgroup' option (#6330) Bump jurt from 6.3.2 to 6.4.3 (#6325) Bump unoil from 6.3.2 to 6.4.3 (#6320) Bump ridl from 6.3.2 to 6.4.3 (#6326) Bump classgraph from 4.8.69 to 4.8.71 (#6322) Bump flexmark from 0.61.6 to 0.61.16 (#6318) Bump richtextfx from 0.10.4 to 0.10.5 (#6319) Bump guava from 28.2-jre to 29.0-jre (#6323) Bump flexmark-ext-gfm-tasklist from 0.61.6 to 0.61.16 (#6327) Bump org.beryx.jlink from 2.17.5 to 2.17.7 (#6324) Improve performance massively by fixing a stupid binding mistake (#6316) Fixed missing paste command (#6313) ...
7bde3e4 Add style for the Geographical Analysis journal (#6145) 6fa1551 Create taylor-and-francis-chicago-b-author-date.csl (#6232) eba2e8c Create taylor-and-francis-ama.csl (#6221) dda9d57 ACS, AMA, Vancouver: Remove hardcoded space after `citation-number` (#6248) 8f5fe92 GitHub Workflows security hardening (#6246) 284bc10 Create angiology.csl (#6122) eb141cc Update society-of-biblical-literature-fullnote-bibliography.csl (#6157) dddb459 Rewrite law-citation-manual.csl (#6171) (#6171) b975c96 Update Cell to numeric-superscript style (#6245) 3a41b08 Create isara-iso-690.csl (#6201) 5a128fe Create Biomembranes.csl (#6200) da2e0c0 Capitalize-first short titles for legislation ("Statute"). (#6241) af7f08d Create proceedings-of-the-estonian-academy-of-sciences-author-date.csl (#6209) git-subtree-dir: buildres/csl/csl-styles git-subtree-split: 7bde3e4
This PR is a follow up to #6171
It aims to extract all the calls to JabRefPreferences::get or ::put in relation to EntryEditorPreferences and to use EntryEditorPreferences instead.