diff --git a/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java b/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java
index ae29cd9d32f..07c8eb9eec0 100644
--- a/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java
+++ b/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java
@@ -124,6 +124,7 @@ private void selectBstFile(ActionEvent event) {
dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(bstFile -> {
BstPreviewLayout bstPreviewLayout = new BstPreviewLayout(bstFile);
viewModel.availableListProperty().add(bstPreviewLayout);
+ viewModel.chosenListProperty().add(bstPreviewLayout);
});
}
diff --git a/src/main/java/org/jabref/logic/bst/BstFunctions.java b/src/main/java/org/jabref/logic/bst/BstFunctions.java
index c12826168bf..dbe1f44006e 100644
--- a/src/main/java/org/jabref/logic/bst/BstFunctions.java
+++ b/src/main/java/org/jabref/logic/bst/BstFunctions.java
@@ -164,7 +164,7 @@ private void bstEquals(BstVMVisitor visitor, ParserRuleContext ctx) {
}
/**
- * Pops the top two (integer) literals and pushes their sum.
+ * Pops the top two (integer) literals and pushes their sum.
*/
private void bstAdd(BstVMVisitor visitor, ParserRuleContext ctx) {
if (stack.size() < 2) {
@@ -328,6 +328,10 @@ public void execute(BstVMVisitor visitor, ParserRuleContext ctx, BstEntry bstEnt
} else {
String entryType = bstEntry.entry.getType().getName();
LOGGER.trace("Handling {}", entryType);
+ if (!functions.containsKey(entryType)) {
+ LOGGER.error("Function for {} not found ", entryType);
+ return;
+ }
functions.get(entryType).execute(visitor, ctx, bstEntry);
}
}
@@ -753,7 +757,7 @@ private void bstSwap(BstVMVisitor visitor, ParserRuleContext ctx) {
* precisely, a "special character", defined in Section 4) counts as
* a single text character, even if it's missing its matching right
* brace, and where braces don't count as text characters.
- *
+ *
* From BibTeXing: For the purposes of counting letters in labels,
* BibTEX considers everything contained inside the braces as a
* single letter.
diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties
index 21c49a26efb..07b38d07b25 100644
--- a/src/main/resources/l10n/JabRef_en.properties
+++ b/src/main/resources/l10n/JabRef_en.properties
@@ -665,6 +665,8 @@ Preferences\ recorded.=Preferences recorded.
Preview=Preview
Citation\ Style=Citation Style
Current\ Preview=Current Preview
+Add\ BST\ file=Add BST file
+
Cannot\ generate\ preview\ based\ on\ selected\ citation\ style.=Cannot generate preview based on selected citation style.
Bad\ character\ inside\ entry=Bad character inside entry
Error\ while\ generating\ citation\ style=Error while generating citation style
From 83b4cbb3de98e7774fe97aaea954debd585ee41b Mon Sep 17 00:00:00 2001
From: Siedlerchr
Date: Mon, 20 May 2024 12:55:32 +0200
Subject: [PATCH 23/28] Fix storing of style in Preferences add to layout cycle
Apply some intellij logger suggestions
---
.../gui/preferences/preview/PreviewTab.java | 5 +--
.../preview/PreviewTabViewModel.java | 22 +++++++++-
.../org/jabref/logic/bst/BstFunctions.java | 4 +-
.../jabref/logic/bst/BstPreviewLayout.java | 8 ++++
.../jabref/preferences/JabRefPreferences.java | 42 +++++++++++++------
.../preferences/PreviewPreferences.java | 14 ++++++-
6 files changed, 76 insertions(+), 19 deletions(-)
diff --git a/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java b/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java
index 07c8eb9eec0..adc91474e8a 100644
--- a/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java
+++ b/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java
@@ -121,10 +121,9 @@ private void selectBstFile(ActionEvent event) {
.withInitialDirectory(preferencesService.getFilePreferences().getWorkingDirectory())
.build();
+
dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(bstFile -> {
- BstPreviewLayout bstPreviewLayout = new BstPreviewLayout(bstFile);
- viewModel.availableListProperty().add(bstPreviewLayout);
- viewModel.chosenListProperty().add(bstPreviewLayout);
+ viewModel.addBstStyle(bstFile);
});
}
diff --git a/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java b/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java
index 03847130963..55c0f8afa60 100644
--- a/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java
+++ b/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java
@@ -1,5 +1,6 @@
package org.jabref.gui.preferences.preview;
+import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -11,6 +12,7 @@
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ListProperty;
import javafx.beans.property.ObjectProperty;
+import javafx.beans.property.Property;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleListProperty;
import javafx.beans.property.SimpleObjectProperty;
@@ -33,6 +35,7 @@
import org.jabref.gui.util.CustomLocalDragboard;
import org.jabref.gui.util.NoSelectionModel;
import org.jabref.gui.util.TaskExecutor;
+import org.jabref.logic.bst.BstPreviewLayout;
import org.jabref.logic.citationstyle.CitationStyle;
import org.jabref.logic.citationstyle.CitationStylePreviewLayout;
import org.jabref.logic.l10n.Localization;
@@ -70,6 +73,8 @@ public class PreviewTabViewModel implements PreferenceTabViewModel {
private final ListProperty chosenListProperty = new SimpleListProperty<>(FXCollections.observableArrayList());
private final ObjectProperty> chosenSelectionModelProperty = new SimpleObjectProperty<>(new NoSelectionModel<>());
+ private final ListProperty bstStylesPaths = new SimpleListProperty<>(FXCollections.observableArrayList());
+
private final BooleanProperty selectedIsEditableProperty = new SimpleBooleanProperty(false);
private final ObjectProperty selectedLayoutProperty = new SimpleObjectProperty<>();
private final StringProperty sourceTextProperty = new SimpleStringProperty("");
@@ -123,6 +128,7 @@ public void setValues() {
availableListProperty.getValue().add(previewPreferences.getCustomPreviewLayout());
}
+
BackgroundTask.wrap(CitationStyle::discoverCitationStyles)
.onSuccess(styles -> styles.stream()
.map(style -> new CitationStylePreviewLayout(style, Globals.entryTypesManager))
@@ -135,6 +141,12 @@ public void setValues() {
dialogService.showErrorDialogAndWait(Localization.lang("Error adding discovered CitationStyles"), ex);
})
.executeWith(taskExecutor);
+ bstStylesPaths.clear();
+ bstStylesPaths.addAll(previewPreferences.getBstPreviewLayoutPaths());
+ bstStylesPaths.forEach(path -> {
+ BstPreviewLayout layout = new BstPreviewLayout(path);
+ availableListProperty.add(layout);
+ });
}
public void setPreviewLayout(PreviewLayout selectedLayout) {
@@ -194,10 +206,11 @@ public void storeSettings() {
previewPreferences.setShowPreviewAsExtraTab(showAsExtraTabProperty.getValue());
previewPreferences.setShowPreviewEntryTableTooltip(showPreviewInEntryTableTooltip.getValue());
previewPreferences.setCustomPreviewLayout((TextBasedPreviewLayout) customLayout);
+ previewPreferences.setBstPreviewLayoutPaths(bstStylesPaths);
if (!chosenSelectionModelProperty.getValue().getSelectedItems().isEmpty()) {
previewPreferences.setLayoutCyclePosition(chosenListProperty.getValue().indexOf(
- chosenSelectionModelProperty.getValue().getSelectedItems().get(0)));
+ chosenSelectionModelProperty.getValue().getSelectedItems().getFirst()));
}
}
@@ -483,4 +496,11 @@ public ObjectProperty selectedLayoutProperty() {
public StringProperty sourceTextProperty() {
return sourceTextProperty;
}
+
+ public void addBstStyle(Path bstFile) {
+ BstPreviewLayout bstPreviewLayout = new BstPreviewLayout(bstFile);
+ bstStylesPaths.add(bstFile);
+ availableListProperty().add(bstPreviewLayout);
+ chosenListProperty().add(bstPreviewLayout);
+ }
}
diff --git a/src/main/java/org/jabref/logic/bst/BstFunctions.java b/src/main/java/org/jabref/logic/bst/BstFunctions.java
index dbe1f44006e..3eab0713a87 100644
--- a/src/main/java/org/jabref/logic/bst/BstFunctions.java
+++ b/src/main/java/org/jabref/logic/bst/BstFunctions.java
@@ -306,7 +306,7 @@ private void bstAddPeriod(BstVMVisitor visitor, ParserRuleContext ctx) {
}
/**
- * Executes the function whose name is the entry type of an entry.
+ * Executes the function whose name is the entry type of entry.
* For example if an entry is of type book, this function executes
* the book function. When given as an argument to the ITERATE
* command, call.type$ actually produces the output for the entries.
@@ -447,7 +447,7 @@ private void bstEmpty(BstVMVisitor visitor, ParserRuleContext ctx) {
throw new BstVMException("Operand does not match function empty$ (line %d)".formatted(ctx.start.getLine()));
}
- boolean result = "".equals(s.trim());
+ boolean result = s.trim().isEmpty();
LOGGER.trace("empty$({}) result: {}", s, result);
stack.push(result ? BstVM.TRUE : BstVM.FALSE);
}
diff --git a/src/main/java/org/jabref/logic/bst/BstPreviewLayout.java b/src/main/java/org/jabref/logic/bst/BstPreviewLayout.java
index c99d085393f..f32b9e21e6f 100644
--- a/src/main/java/org/jabref/logic/bst/BstPreviewLayout.java
+++ b/src/main/java/org/jabref/logic/bst/BstPreviewLayout.java
@@ -12,6 +12,7 @@
import org.jabref.logic.layout.format.RemoveLatexCommandsFormatter;
import org.jabref.logic.layout.format.RemoveTilde;
import org.jabref.logic.preview.PreviewLayout;
+import org.jabref.logic.util.StandardFileType;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
@@ -98,4 +99,11 @@ public String getName() {
public String getText() {
return source;
}
+
+ /**
+ * Checks if the given style file is a BST file by checking the extension
+ */
+ public static boolean isBstStyleFile(String styleFile) {
+ return StandardFileType.BST.getExtensions().stream().anyMatch(styleFile::endsWith);
+ }
}
diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java
index 59b01569a34..8db0f09c876 100644
--- a/src/main/java/org/jabref/preferences/JabRefPreferences.java
+++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java
@@ -63,6 +63,7 @@
import org.jabref.gui.theme.Theme;
import org.jabref.logic.JabRefException;
import org.jabref.logic.bibtex.FieldPreferences;
+import org.jabref.logic.bst.BstPreviewLayout;
import org.jabref.logic.citationkeypattern.CitationKeyPattern;
import org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences;
import org.jabref.logic.citationkeypattern.GlobalCitationKeyPatterns;
@@ -386,6 +387,7 @@ public class JabRefPreferences implements PreferencesService {
public static final String CYCLE_PREVIEW = "cyclePreview";
public static final String PREVIEW_AS_TAB = "previewAsTab";
public static final String PREVIEW_IN_ENTRY_TABLE_TOOLTIP = "previewInEntryTableTooltip";
+ public static final String PREVIEW_BST_LAYOUT_PATHS = "previewBstLayoutPaths";
// UI
private static final String FONT_FAMILY = "fontFamily";
@@ -515,7 +517,7 @@ private JabRefPreferences() {
importPreferences(Path.of("jabref.xml"));
}
} catch (JabRefException e) {
- LOGGER.warn("Could not import preferences from jabref.xml: " + e.getMessage(), e);
+ LOGGER.warn("Could not import preferences from jabref.xml: {}", e.getMessage(), e);
}
// load user preferences
@@ -1088,7 +1090,7 @@ public void flush() {
try {
exportPreferences(Path.of("jabref.xml"));
} catch (JabRefException e) {
- LOGGER.warn("Could not export preferences for memory stick mode: " + e.getMessage(), e);
+ LOGGER.warn("Could not export preferences for memory stick mode: {}", e.getMessage(), e);
}
}
try {
@@ -1643,7 +1645,7 @@ private String getProxyPassword() {
} catch (PasswordAccessException ex) {
LOGGER.warn("JabRef uses proxy password from key store but no password is stored");
} catch (Exception ex) {
- LOGGER.warn("JabRef could not open the key store");
+ LOGGER.warn("JabRef could not open the key store", ex);
}
}
return (String) defaults.get(PROXY_PASSWORD);
@@ -2110,7 +2112,8 @@ public InternalPreferences getInternalPreferences() {
if (!newValue) {
try {
Files.deleteIfExists(Path.of("jabref.xml"));
- } catch (IOException e) {
+ } catch (
+ IOException e) {
LOGGER.warn("Error accessing filesystem", e);
}
}
@@ -2431,17 +2434,25 @@ public PreviewPreferences getPreviewPreferences() {
new TextBasedPreviewLayout(style, getLayoutFormatterPreferences(), Globals.journalAbbreviationRepository),
(String) defaults.get(PREVIEW_STYLE),
getBoolean(PREVIEW_AS_TAB),
- getBoolean(PREVIEW_IN_ENTRY_TABLE_TOOLTIP));
+ getBoolean(PREVIEW_IN_ENTRY_TABLE_TOOLTIP),
+ getStringList(PREVIEW_BST_LAYOUT_PATHS).stream()
+ .map(Path::of)
+ .collect(Collectors.toList())
+ );
previewPreferences.getLayoutCycle().addListener((InvalidationListener) c -> storePreviewLayouts(previewPreferences.getLayoutCycle()));
EasyBind.listen(previewPreferences.layoutCyclePositionProperty(), (obs, oldValue, newValue) -> putInt(CYCLE_PREVIEW_POS, newValue));
EasyBind.listen(previewPreferences.customPreviewLayoutProperty(), (obs, oldValue, newValue) -> put(PREVIEW_STYLE, newValue.getText()));
EasyBind.listen(previewPreferences.showPreviewAsExtraTabProperty(), (obs, oldValue, newValue) -> putBoolean(PREVIEW_AS_TAB, newValue));
EasyBind.listen(previewPreferences.showPreviewEntryTableTooltip(), (obs, oldValue, newValue) -> putBoolean(PREVIEW_IN_ENTRY_TABLE_TOOLTIP, newValue));
-
+ previewPreferences.getBstPreviewLayoutPaths().addListener((InvalidationListener) c -> storeBstPaths(previewPreferences.getBstPreviewLayoutPaths()));
return this.previewPreferences;
}
+ private void storeBstPaths(List bstPaths) {
+ putStringList(PREVIEW_BST_LAYOUT_PATHS, bstPaths.stream().map(Path::toAbsolutePath).map(Path::toString).toList());
+ }
+
private List getPreviewLayouts(String style) {
List cycle = getStringList(CYCLE_PREVIEW);
@@ -2456,11 +2467,17 @@ private List getPreviewLayouts(String style) {
return CitationStyle.createCitationStyleFromFile(layout)
.map(file -> (PreviewLayout) new CitationStylePreviewLayout(file, Globals.entryTypesManager))
.orElse(null);
+ }
+ if (BstPreviewLayout.isBstStyleFile(layout)) {
+ return getStringList(PREVIEW_BST_LAYOUT_PATHS).stream()
+ .filter(path -> path.endsWith(layout)).map(Path::of)
+ .map(file -> (BstPreviewLayout) new BstPreviewLayout(file))
+ .findFirst()
+ .orElse(null);
} else {
return new TextBasedPreviewLayout(style, getLayoutFormatterPreferences(), Globals.journalAbbreviationRepository);
}
- })
- .filter(Objects::nonNull)
+ }).filter(Objects::nonNull)
.collect(Collectors.toList());
}
@@ -2541,9 +2558,9 @@ private Map getSidePanePreferredPositions() {
SidePaneType type = Enum.valueOf(SidePaneType.class, name);
preferredPositions.put(type, Integer.parseInt(componentPositions.get(i)));
} catch (NumberFormatException e) {
- LOGGER.debug("Invalid number format for side pane component '" + name + "'", e);
+ LOGGER.debug("Invalid number format for side pane component '{}'", name, e);
} catch (IllegalArgumentException e) {
- LOGGER.debug("Following component is not a side pane: '" + name + "'", e);
+ LOGGER.debug("Following component is not a side pane: '{}'", name, e);
}
}
@@ -3016,7 +3033,8 @@ private void storeFetcherKeysToKeyring(List names, List keys) {
if (StringUtil.isNullOrEmpty(keys.get(i))) {
try {
keyring.deletePassword("org.jabref.customapikeys", names.get(i));
- } catch (PasswordAccessException ex) {
+ } catch (
+ PasswordAccessException ex) {
// Already removed
}
} else {
@@ -3027,7 +3045,7 @@ private void storeFetcherKeysToKeyring(List names, List keys) {
}
}
} catch (Exception ex) {
- LOGGER.error("Unable to open key store");
+ LOGGER.error("Unable to open key store", ex);
}
}
diff --git a/src/main/java/org/jabref/preferences/PreviewPreferences.java b/src/main/java/org/jabref/preferences/PreviewPreferences.java
index 563efd0071c..3d607724dc7 100644
--- a/src/main/java/org/jabref/preferences/PreviewPreferences.java
+++ b/src/main/java/org/jabref/preferences/PreviewPreferences.java
@@ -1,5 +1,6 @@
package org.jabref.preferences;
+import java.nio.file.Path;
import java.util.List;
import javafx.beans.property.BooleanProperty;
@@ -24,19 +25,22 @@ public class PreviewPreferences {
private final StringProperty defaultCustomPreviewLayout;
private final BooleanProperty showPreviewAsExtraTab;
private final BooleanProperty showPreviewEntryTableTooltip;
+ private final ObservableList bstPreviewLayoutPaths;
public PreviewPreferences(List layoutCycle,
int layoutCyclePosition,
TextBasedPreviewLayout customPreviewLayout,
String defaultCustomPreviewLayout,
boolean showPreviewAsExtraTab,
- boolean showPreviewEntryTableTooltip) {
+ boolean showPreviewEntryTableTooltip,
+ List bstPreviewLayoutPaths) {
this.layoutCycle = FXCollections.observableArrayList(layoutCycle);
this.layoutCyclePosition = new SimpleIntegerProperty(layoutCyclePosition);
this.customPreviewLayout = new SimpleObjectProperty<>(customPreviewLayout);
this.defaultCustomPreviewLayout = new SimpleStringProperty(defaultCustomPreviewLayout);
this.showPreviewAsExtraTab = new SimpleBooleanProperty(showPreviewAsExtraTab);
this.showPreviewEntryTableTooltip = new SimpleBooleanProperty(showPreviewEntryTableTooltip);
+ this.bstPreviewLayoutPaths = FXCollections.observableList(bstPreviewLayoutPaths);
}
public ObservableList getLayoutCycle() {
@@ -112,4 +116,12 @@ public void setShowPreviewEntryTableTooltip(boolean showPreviewEntryTableTooltip
public BooleanProperty showPreviewEntryTableTooltip() {
return showPreviewEntryTableTooltip;
}
+
+ public ObservableList getBstPreviewLayoutPaths() {
+ return bstPreviewLayoutPaths;
+ }
+
+ public void setBstPreviewLayoutPaths(List bstPreviewLayoutPaths) {
+ this.bstPreviewLayoutPaths.setAll(bstPreviewLayoutPaths);
+ }
}
From 380aa6b60e77060cf924b7c7d8e003633cd9bb83 Mon Sep 17 00:00:00 2001
From: Siedlerchr
Date: Mon, 20 May 2024 13:02:31 +0200
Subject: [PATCH 24/28] wording of changelog
---
CHANGELOG.md | 2 +-
src/main/java/org/jabref/preferences/JabRefPreferences.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 98029604043..6ba222766b1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,7 +19,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- Added a formatter to remove word enclosing braces. [#11222](https://github.com/JabRef/jabref/issues/11222)
- We added the ability to add a keyword/crossref when typing the separator character (e.g., comma) in the keywords/crossref fields. [#11178](https://github.com/JabRef/jabref/issues/11178)
- We added an exporter and improved the importer for Endnote XML format. [#11137](https://github.com/JabRef/jabref/issues/11137)
-- We added a button in gui to give users an easy option to select and add local bst files to available styles in preview layout list. [#11102](https://github.com/JabRef/jabref/issues/11102)
+- We added support for using BibTeX Style files (BST) in the Preview. [#11102](https://github.com/JabRef/jabref/issues/11102)
- We added support for automatically update LaTeX citations when a LaTeX file is created, removed, or modified. [#10585](https://github.com/JabRef/jabref/issues/10585)
### Changed
diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java
index 8db0f09c876..880ce6b3340 100644
--- a/src/main/java/org/jabref/preferences/JabRefPreferences.java
+++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java
@@ -175,7 +175,7 @@ public class JabRefPreferences implements PreferencesService {
public static final String NAMES_AS_IS = "namesAsIs";
public static final String ENTRY_EDITOR_HEIGHT = "entryEditorHeightFX";
/**
- * Holds the horizontal divider position of the preview view when it is shown inside the entry editor
+ * Holds the horizontal divider position of the preview view when it is shown inside the entry editor
*/
public static final String ENTRY_EDITOR_PREVIEW_DIVIDER_POS = "entryEditorPreviewDividerPos";
public static final String AUTO_RESIZE_MODE = "autoResizeMode";
From a3aaf3f80c1894f5aa4b65a568c5bc84250905b0 Mon Sep 17 00:00:00 2001
From: Siedlerchr
Date: Mon, 20 May 2024 13:05:03 +0200
Subject: [PATCH 25/28] cehckstyle
---
.../org/jabref/gui/preferences/preview/PreviewTabViewModel.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java b/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java
index 55c0f8afa60..fd35a512213 100644
--- a/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java
+++ b/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java
@@ -12,7 +12,6 @@
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ListProperty;
import javafx.beans.property.ObjectProperty;
-import javafx.beans.property.Property;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleListProperty;
import javafx.beans.property.SimpleObjectProperty;
From 574c87d310b8a976c1975e8c8a4d491a2eebcc80 Mon Sep 17 00:00:00 2001
From: Siedlerchr
Date: Mon, 20 May 2024 13:27:13 +0200
Subject: [PATCH 26/28] checkstyle
---
.../java/org/jabref/gui/preferences/preview/PreviewTab.java | 2 --
.../org/jabref/gui/preferences/preview/PreviewTabViewModel.java | 1 -
2 files changed, 3 deletions(-)
diff --git a/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java b/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java
index adc91474e8a..4a66c9ee5ba 100644
--- a/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java
+++ b/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java
@@ -34,7 +34,6 @@
import org.jabref.gui.util.FileDialogConfiguration;
import org.jabref.gui.util.IconValidationDecorator;
import org.jabref.gui.util.ViewModelListCellFactory;
-import org.jabref.logic.bst.BstPreviewLayout;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.preview.PreviewLayout;
import org.jabref.logic.util.StandardFileType;
@@ -121,7 +120,6 @@ private void selectBstFile(ActionEvent event) {
.withInitialDirectory(preferencesService.getFilePreferences().getWorkingDirectory())
.build();
-
dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(bstFile -> {
viewModel.addBstStyle(bstFile);
});
diff --git a/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java b/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java
index fd35a512213..66b55041740 100644
--- a/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java
+++ b/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java
@@ -127,7 +127,6 @@ public void setValues() {
availableListProperty.getValue().add(previewPreferences.getCustomPreviewLayout());
}
-
BackgroundTask.wrap(CitationStyle::discoverCitationStyles)
.onSuccess(styles -> styles.stream()
.map(style -> new CitationStylePreviewLayout(style, Globals.entryTypesManager))
From 57aa305dd1eb24f7a913dcacf4fa8ab02521f31a Mon Sep 17 00:00:00 2001
From: Siedlerchr
Date: Mon, 20 May 2024 13:41:26 +0200
Subject: [PATCH 27/28] fix line break
---
src/main/java/org/jabref/preferences/JabRefPreferences.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java
index 880ce6b3340..295bc277991 100644
--- a/src/main/java/org/jabref/preferences/JabRefPreferences.java
+++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java
@@ -2112,8 +2112,7 @@ public InternalPreferences getInternalPreferences() {
if (!newValue) {
try {
Files.deleteIfExists(Path.of("jabref.xml"));
- } catch (
- IOException e) {
+ } catch (IOException e) {
LOGGER.warn("Error accessing filesystem", e);
}
}
From 225dab0699b818dd3d7737d4d4c16dcaf9a3d41e Mon Sep 17 00:00:00 2001
From: Siedlerchr
Date: Mon, 20 May 2024 13:42:08 +0200
Subject: [PATCH 28/28] damn style
---
src/main/java/org/jabref/preferences/JabRefPreferences.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java
index 295bc277991..0d90ffa60f8 100644
--- a/src/main/java/org/jabref/preferences/JabRefPreferences.java
+++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java
@@ -3032,8 +3032,7 @@ private void storeFetcherKeysToKeyring(List names, List keys) {
if (StringUtil.isNullOrEmpty(keys.get(i))) {
try {
keyring.deletePassword("org.jabref.customapikeys", names.get(i));
- } catch (
- PasswordAccessException ex) {
+ } catch (PasswordAccessException ex) {
// Already removed
}
} else {