Skip to content

Commit 58997cb

Browse files
motokitotobiasdiez
authored andcommitted
Refactoring for PR #2051 (#2202)
* Fixing: Sensible default settings for "Enable save actions" and "Cleanup" * Sensible default settings for "Enable save actions" in database properties and "Cleanup entries" in menu are now identical * Insert allTextField fieldName and refactoring the reset entries of database properties * CHANGELOG Fixing * Feedback * rename all_text_fields to all-text-fields * remove ISBN and ISSN, MONTH, DATE, YEAR form all-text-fields * Create Recommend Button for BibTex and BibLatex and refactor reset button incl. defaut setting * Refactoring: * Rename BibTex and BibLaTex to BibTeX and BibLaTeX * Rename Formatter list of BibTeX and BibLaTeX * Refactoring_15102016_2343: "Recommended for %0" button is now disabled, if save actions are not enabled * Fix LocalizationConsistencyTest FAIL: * Testcase ensureNoDuplicates in JabRef_vi.properties * Refactoring: * create test for fieldformattercleanup * refactoring for default * add OrdinalsToSuperscriptFormatter to recommand button * REFACTORING_27102016_0744: * rename the recommended list * change "isBibTex" to "isBibLatex" * Follow to refactor_27102016_1340
1 parent 5ea3a7d commit 58997cb

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/main/java/net/sf/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java

+4-9
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import net.sf.jabref.model.cleanup.FieldFormatterCleanup;
3232
import net.sf.jabref.model.cleanup.FieldFormatterCleanups;
3333
import net.sf.jabref.model.cleanup.Formatter;
34+
import net.sf.jabref.model.database.BibDatabaseContext;
3435
import net.sf.jabref.model.entry.BibEntry;
3536
import net.sf.jabref.model.entry.InternalBibtexFields;
3637
import net.sf.jabref.model.metadata.MetaData;
@@ -133,18 +134,12 @@ public void contentsChanged(ListDataEvent e) {
133134
resetButton = new JButton(Localization.lang("Reset"));
134135
resetButton.addActionListener(e -> ((CleanupActionsListModel) actionsList.getModel()).reset(defaultFormatters));
135136

136-
boolean isBibLaTeX = JabRefGUI.getMainFrame().getCurrentBasePanel().getDatabaseContext().isBiblatexMode();
137-
String mode;
137+
BibDatabaseContext databaseContext = JabRefGUI.getMainFrame().getCurrentBasePanel().getDatabaseContext();
138138

139-
if (isBibLaTeX) {
140-
mode = "BibLaTeX";
141-
} else {
142-
mode = "BibTeX";
143-
}
139+
recommendButton = new JButton(Localization.lang("Recommended for %0", databaseContext.getMode().getFormattedName()));
140+
boolean isBibLaTeX = databaseContext.isBiblatexMode();
144141

145-
recommendButton = new JButton(Localization.lang("Recommended for %0", mode));
146142
recommendButton.addActionListener(e -> {
147-
148143
if (isBibLaTeX) {
149144
((CleanupActionsListModel) actionsList.getModel()).reset(Cleanups.RECOMMEND_BIBLATEX_ACTIONS);
150145
} else {

0 commit comments

Comments
 (0)