From 0316d76d02c4a35a0c03377f7db34a3cc617fc69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20M=C3=A9ndez?= Date: Sun, 18 Aug 2019 14:12:23 +0200 Subject: [PATCH 1/9] Fix tooltips in CitationsDisplay (#5188) * Fix tooltips in CitationsDisplay * Rename withTooltip(Callback) to withStringTooltip() in ViewModelListCellFactory * Add withTooltip(Callback) to ViewModelListCellFactory * Update CitationsDisplay for using ViewModelListCellFactory --- .../cleanup/FieldFormatterCleanupsPanel.java | 4 +- .../gui/fieldeditors/LinkedFilesEditor.java | 2 +- .../gui/texparser/CitationsDisplay.java | 44 +++++++++++++++++-- .../gui/util/ViewModelListCellFactory.java | 26 ++++++----- .../org/jabref/model/texparser/Citation.java | 6 +-- 5 files changed, 63 insertions(+), 19 deletions(-) diff --git a/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java b/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java index ffb8aa18e69..12cd47ccf92 100644 --- a/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java +++ b/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java @@ -105,7 +105,7 @@ private void buildLayout() { actionsList.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); new ViewModelListCellFactory() .withText(action -> action.getField() + ": " + action.getFormatter().getName()) - .withTooltip(action -> action.getFormatter().getDescription()) + .withStringTooltip(action -> action.getFormatter().getDescription()) .install(actionsList); add(actionsList, 1, 1, 3, 1); @@ -171,7 +171,7 @@ private GridPane getSelectorPanel() { formattersCombobox = new ComboBox<>(FXCollections.observableArrayList(availableFormatters)); new ViewModelListCellFactory() .withText(Formatter::getName) - .withTooltip(Formatter::getDescription) + .withStringTooltip(Formatter::getDescription) .install(formattersCombobox); EasyBind.subscribe(formattersCombobox.valueProperty(), e -> updateDescription()); builder.add(formattersCombobox, 3, 1); diff --git a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java index e44ce682e00..725c206ffa6 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java @@ -65,7 +65,7 @@ public LinkedFilesEditor(Field field, DialogService dialogService, BibDatabaseCo .load(); ViewModelListCellFactory cellFactory = new ViewModelListCellFactory() - .withTooltip(LinkedFileViewModel::getDescription) + .withStringTooltip(LinkedFileViewModel::getDescription) .withGraphic(LinkedFilesEditor::createFileDisplay) .withContextMenu(this::createContextMenuForFile) .withOnMouseClickedEvent(this::handleItemMouseClick) diff --git a/src/main/java/org/jabref/gui/texparser/CitationsDisplay.java b/src/main/java/org/jabref/gui/texparser/CitationsDisplay.java index c75257559d3..3988b2a427c 100644 --- a/src/main/java/org/jabref/gui/texparser/CitationsDisplay.java +++ b/src/main/java/org/jabref/gui/texparser/CitationsDisplay.java @@ -1,15 +1,20 @@ package org.jabref.gui.texparser; import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.scene.Node; +import javafx.scene.control.ContentDisplay; import javafx.scene.control.Label; import javafx.scene.control.ListView; +import javafx.scene.control.Tooltip; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.scene.text.Text; +import javafx.scene.text.TextFlow; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.util.ViewModelListCellFactory; @@ -18,12 +23,12 @@ public class CitationsDisplay extends ListView { - private ObjectProperty basePath; + private final ObjectProperty basePath; public CitationsDisplay() { this.basePath = new SimpleObjectProperty<>(null); new ViewModelListCellFactory().withGraphic(this::getDisplayGraphic) - .withTooltip(Citation::getLineText) + .withTooltip(this::getDisplayTooltip) .install(this); } @@ -31,7 +36,7 @@ public ObjectProperty basePathProperty() { return basePath; } - public Node getDisplayGraphic(Citation item) { + private Node getDisplayGraphic(Citation item) { if (basePath.get() == null) { basePath.set(item.getPath().getRoot()); } @@ -52,4 +57,37 @@ public Node getDisplayGraphic(Citation item) { return new VBox(contextBox, dataBox); } + + private Tooltip getDisplayTooltip(Citation item) { + String line = item.getLineText(); + int start = item.getColStart(); + int end = item.getColEnd(); + + List texts = new ArrayList<>(3); + + // Text before the citation. + if (start > 0) { + texts.add(new Text(line.substring(0, start))); + } + + // Citation text (highlighted). + Text citation = new Text(line.substring(start, end)); + citation.getStyleClass().setAll("tooltip-text-bold"); + texts.add(citation); + + // Text after the citation. + if (end < line.length()) { + texts.add(new Text(line.substring(end))); + } + + Tooltip tooltip = new Tooltip(); + tooltip.setContentDisplay(ContentDisplay.GRAPHIC_ONLY); + tooltip.setGraphic(new TextFlow(texts.toArray(new Text[0]))); + tooltip.setMaxHeight(10); + tooltip.setMinWidth(200); + tooltip.maxWidthProperty().bind(this.widthProperty().subtract(85)); + tooltip.setWrapText(true); + + return tooltip; + } } diff --git a/src/main/java/org/jabref/gui/util/ViewModelListCellFactory.java b/src/main/java/org/jabref/gui/util/ViewModelListCellFactory.java index 3f58f3cc9b3..87b9120b69b 100644 --- a/src/main/java/org/jabref/gui/util/ViewModelListCellFactory.java +++ b/src/main/java/org/jabref/gui/util/ViewModelListCellFactory.java @@ -32,7 +32,7 @@ public class ViewModelListCellFactory implements Callback, ListCe private Callback toText; private Callback toGraphic; - private Callback toTooltip; + private Callback toTooltip; private BiConsumer toOnMouseClickedEvent; private Callback toStyleClass; private Callback toContextMenu; @@ -58,9 +58,8 @@ public ViewModelListCellFactory withIcon(Callback toIcon) { GlyphIcons icon = toIcon.call(viewModel); if (icon != null) { return MaterialDesignIconFactory.get().createIcon(icon); - } else { - return null; } + return null; }; return this; } @@ -74,7 +73,18 @@ public ViewModelListCellFactory withIcon(Callback toIcon, Call return this; } - public ViewModelListCellFactory withTooltip(Callback toTooltip) { + public ViewModelListCellFactory withStringTooltip(Callback toStringTooltip) { + this.toTooltip = viewModel -> { + String tooltipText = toStringTooltip.call(viewModel); + if (StringUtil.isNotBlank(tooltipText)) { + return new Tooltip(tooltipText); + } + return null; + }; + return this; + } + + public ViewModelListCellFactory withTooltip(Callback toTooltip) { this.toTooltip = toTooltip; return this; } @@ -89,8 +99,7 @@ public ViewModelListCellFactory withStyleClass(Callback toStyleCla return this; } - public ViewModelListCellFactory withOnMouseClickedEvent( - BiConsumer toOnMouseClickedEvent) { + public ViewModelListCellFactory withOnMouseClickedEvent(BiConsumer toOnMouseClickedEvent) { this.toOnMouseClickedEvent = toOnMouseClickedEvent; return this; } @@ -163,10 +172,7 @@ protected void updateItem(T item, boolean empty) { getStyleClass().setAll(toStyleClass.call(viewModel)); } if (toTooltip != null) { - String tooltipText = toTooltip.call(viewModel); - if (StringUtil.isNotBlank(tooltipText)) { - setTooltip(new Tooltip(tooltipText)); - } + setTooltip(toTooltip.call(viewModel)); } if (toContextMenu != null) { setContextMenu(toContextMenu.call(viewModel)); diff --git a/src/main/java/org/jabref/model/texparser/Citation.java b/src/main/java/org/jabref/model/texparser/Citation.java index 6da4c0b7c94..13cf29494ce 100644 --- a/src/main/java/org/jabref/model/texparser/Citation.java +++ b/src/main/java/org/jabref/model/texparser/Citation.java @@ -8,7 +8,7 @@ public class Citation { /** * The total number of characters that are shown around a cite (cite width included). */ - private static final int CONTEXT_WIDTH = 200; + private static final int CONTEXT_WIDTH = 300; private final Path path; private final int line; @@ -66,9 +66,9 @@ public String getContext() { // Add three dots when the string does not contain all the line. return String.format("%s%s%s", - (start > 0) ? "... " : "", + (start > 0) ? "..." : "", lineText.substring(start, end).trim(), - (end < lineLength) ? " ..." : ""); + (end < lineLength) ? "..." : ""); } @Override From 738837475fc81778ff9b6127928f51c5d928fca2 Mon Sep 17 00:00:00 2001 From: mmihuu <41503450+mmihuu@users.noreply.github.com> Date: Sun, 18 Aug 2019 14:18:43 +0200 Subject: [PATCH 2/9] Fix issue 5152, tooltip and icon added to group cell (#5191) * Fix issue 5152, tooltip and icon added to group cell * -fixed minor issue with style (empty line) in MainTableColumnFactory -added key "Group color" into english language properties --- .../jabref/gui/maintable/MainTableColumnFactory.java | 11 ++++++----- src/main/resources/l10n/JabRef_en.properties | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java b/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java index 0bbe346fe92..f3ae887b505 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java @@ -65,7 +65,7 @@ class MainTableColumnFactory { private final CellFactory cellFactory; private final UndoManager undoManager; private final DialogService dialogService; - + public MainTableColumnFactory(BibDatabaseContext database, ColumnPreferences preferences, ExternalFileTypes externalFileTypes, UndoManager undoManager, DialogService dialogService) { this.database = Objects.requireNonNull(database); @@ -78,9 +78,7 @@ public MainTableColumnFactory(BibDatabaseContext database, ColumnPreferences pre public List> createColumns() { List> columns = new ArrayList<>(); - columns.add(createGroupColumn()); - // Add column for linked files if (preferences.showFileColumn()) { columns.add(createFileColumn()); @@ -116,8 +114,11 @@ public MainTableColumnFactory(BibDatabaseContext database, ColumnPreferences pre private TableColumn createGroupColumn() { TableColumn> column = new TableColumn<>(); - column.getStyleClass().add(GROUP_COLUMN); - setExactWidth(column, 20); + Node headerGraphic = IconTheme.JabRefIcons.DEFAULT_GROUP_ICON.getGraphicNode(); + Tooltip.install(headerGraphic, new Tooltip(Localization.lang("Group color"))); + column.setGraphic(headerGraphic); + column.getStyleClass().add(ICON_COLUMN); + setExactWidth(column, GUIGlobals.WIDTH_ICON_COL); column.setCellValueFactory(cellData -> cellData.getValue().getMatchedGroups(database)); new ValueTableCellFactory>() .withGraphic(this::createGroupColorRegion) diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 2d0503a5235..e61232b2099 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2114,3 +2114,4 @@ No\ LaTeX\ files\ containing\ this\ entry\ were\ found.=No LaTeX files containin Selected\ entry\ does\ not\ have\ an\ associated\ BibTeX\ key.=Selected entry does not have an associated BibTeX key. Current\ search\ directory\:=Current search directory: Set\ LaTeX\ file\ directory=Set LaTeX file directory +Group\ color=Group color From be29e740bd2c6647a94631644d880c236729990e Mon Sep 17 00:00:00 2001 From: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> Date: Sun, 18 Aug 2019 14:21:03 +0200 Subject: [PATCH 3/9] Border for group color indicator and some space for tooltip (#5190) * Initial * Removed Border behind transparent groupRectangle, rewording --- .../gui/maintable/MainTableColumnFactory.java | 53 ++++++++++++------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java b/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java index f3ae887b505..2c2845638e5 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java @@ -9,6 +9,7 @@ import javax.swing.undo.UndoManager; +import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.control.ContextMenu; import javafx.scene.control.MenuItem; @@ -16,7 +17,8 @@ import javafx.scene.control.Tooltip; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; -import javafx.scene.layout.BorderPane; +import javafx.scene.layout.Pane; +import javafx.scene.layout.StackPane; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; @@ -123,29 +125,42 @@ public MainTableColumnFactory(BibDatabaseContext database, ColumnPreferences pre new ValueTableCellFactory>() .withGraphic(this::createGroupColorRegion) .install(column); + column.setStyle("-fx-padding: 0 0 0 0;"); column.setSortable(true); return column; } private Node createGroupColorRegion(BibEntryTableViewModel entry, List matchedGroups) { - Rectangle rectangle = new Rectangle(); - rectangle.setWidth(3); - rectangle.setHeight(20); - Color color = matchedGroups.stream() - .flatMap(group -> OptionalUtil.toStream(group.getColor())) - .findFirst() - .orElse(Color.TRANSPARENT); - rectangle.setFill(color); - - String matchedGroupsString = matchedGroups.stream() - .map(AbstractGroup::getName) - .collect(Collectors.joining(", ")); - Tooltip tooltip = new Tooltip(Localization.lang("Entry is contained in the following groups:") + "\n" + matchedGroupsString); - Tooltip.install(rectangle, tooltip); - - BorderPane container = new BorderPane(); - container.setLeft(rectangle); - return container; + Color groupColor = matchedGroups.stream() + .flatMap(group -> OptionalUtil.toStream(group.getColor())) + .findFirst() + .orElse(Color.TRANSPARENT); + + if (groupColor != Color.TRANSPARENT) { + Rectangle border = new Rectangle(); + border.setWidth(5); + border.setHeight(20); + border.setFill(Color.DARKGRAY); + + Rectangle groupRectangle = new Rectangle(); + groupRectangle.setWidth(3); + groupRectangle.setHeight(18); + groupRectangle.setFill(groupColor); + + StackPane container = new StackPane(); + container.setMinWidth(10); + container.setAlignment(Pos.CENTER); + + container.getChildren().addAll(border,groupRectangle); + + String matchedGroupsString = matchedGroups.stream() + .map(AbstractGroup::getName) + .collect(Collectors.joining(", ")); + Tooltip tooltip = new Tooltip(Localization.lang("Entry is contained in the following groups:") + "\n" + matchedGroupsString); + Tooltip.install(container, tooltip); + return container; + } + return new Pane(); } private List> createNormalColumns() { From 7ec70a52569e90f05bff9ad3881166a98e493fba Mon Sep 17 00:00:00 2001 From: Linus Dietz Date: Sun, 18 Aug 2019 14:31:31 +0200 Subject: [PATCH 4/9] Fix Permissions of LaTeXintegration (#5134) * Differentiate Causes of Errors * Refactor Failure Mode * Remove unnecessary return * Remove redundant lines --- .../gui/texparser/ParseTexDialogViewModel.java | 12 +++++++++++- src/main/resources/l10n/JabRef_en.properties | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/texparser/ParseTexDialogViewModel.java b/src/main/java/org/jabref/gui/texparser/ParseTexDialogViewModel.java index ac2f0c596c6..10b4751ea39 100644 --- a/src/main/java/org/jabref/gui/texparser/ParseTexDialogViewModel.java +++ b/src/main/java/org/jabref/gui/texparser/ParseTexDialogViewModel.java @@ -1,6 +1,7 @@ package org.jabref.gui.texparser; import java.io.IOException; +import java.nio.file.FileSystemException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -126,10 +127,19 @@ public void searchButtonClicked() { noFilesFound.set(false); successfulSearch.set(true); }) - .onFailure(dialogService::showErrorDialogAndWait) + .onFailure(this::handleFailure) .executeWith(taskExecutor); } + private void handleFailure(Exception exception) { + final boolean permissionProblem = exception instanceof IOException && exception.getCause() instanceof FileSystemException && exception.getCause().getMessage().endsWith("Operation not permitted"); + if (permissionProblem) { + dialogService.showErrorDialogAndWait(String.format(Localization.lang("JabRef does not have permission to access %s"), exception.getCause().getMessage())); + } else { + dialogService.showErrorDialogAndWait(exception); + } + } + private FileNodeViewModel searchDirectory(Path directory) throws IOException { if (directory == null || !directory.toFile().isDirectory()) { throw new IOException(String.format("Invalid directory for searching: %s", directory)); diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index e61232b2099..7fc1fffd027 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -1373,6 +1373,7 @@ Open\ %0\ file=Open %0 file Cannot\ delete\ file=Cannot delete file File\ permission\ error=File permission error +JabRef\ does\ not\ have\ permission\ to\ access\ %s=JabRef does not have permission to access %s Push\ to\ %0=Push to %0 Path\ to\ %0=Path to %0 Convert=Convert From f51ba4962d98eae4ea6016f05f8ed2015f484d1a Mon Sep 17 00:00:00 2001 From: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> Date: Sun, 18 Aug 2019 14:45:58 +0200 Subject: [PATCH 5/9] Conversion of preferencesDialog/advancedTab, networkTab and groupsTab to mvvm (#5141) * Converting to mvvm, combining advanced and network * Refactor minor things and cosmetic changes * Convert GroupsTab to mvvm * Fixed l10n * Refactor, reword, abstract and added resetWarning * Reword * Refactored for better readability * Rewording for consistency, trigger travis * Fixed minor bug * Refixed minor bug --- src/main/java/org/jabref/gui/Base.css | 5 + .../java/org/jabref/gui/icon/IconTheme.java | 3 +- .../AbstractPreferenceTabView.java | 37 +++ .../jabref/gui/preferences/AdvancedTab.fxml | 67 +++++ .../jabref/gui/preferences/AdvancedTab.java | 176 ------------ .../gui/preferences/AdvancedTabView.java | 131 +++++++++ .../gui/preferences/AdvancedTabViewModel.java | 253 ++++++++++++++++++ .../gui/preferences/AppearancePrefsTab.java | 8 +- .../preferences/BibtexKeyPatternPrefTab.java | 8 +- .../gui/preferences/EntryEditorPrefsTab.java | 8 +- .../preferences/ExportSortingPrefsTab.java | 8 +- .../jabref/gui/preferences/ExternalTab.fxml | 175 ++++++------ .../gui/preferences/ExternalTabView.java | 114 ++++---- .../gui/preferences/ExternalTabViewModel.java | 6 + .../org/jabref/gui/preferences/FileTab.fxml | 27 +- .../jabref/gui/preferences/FileTabView.java | 96 +++---- .../gui/preferences/FileTabViewModel.java | 7 +- .../jabref/gui/preferences/GeneralTab.fxml | 59 ++-- .../gui/preferences/GeneralTabView.java | 114 ++++---- .../gui/preferences/GeneralTabViewModel.java | 31 ++- .../gui/preferences/GroupsPrefsTab.java | 122 --------- .../org/jabref/gui/preferences/GroupsTab.fxml | 47 ++++ .../jabref/gui/preferences/GroupsTabView.java | 44 +++ .../gui/preferences/GroupsTabViewModel.java | 83 ++++++ .../gui/preferences/ImportSettingsTab.java | 6 +- .../gui/preferences/NameFormatterTab.java | 5 +- .../jabref/gui/preferences/NetworkTab.java | 195 -------------- .../preferences/PreferenceTabViewModel.java | 30 +++ .../preferences/PreferencesDialogView.java | 8 +- .../PreferencesDialogViewModel.java | 60 +++-- .../preferences/PreferencesSearchHandler.java | 26 +- .../gui/preferences/PreferencesTab.java | 50 ++++ .../org/jabref/gui/preferences/PrefsTab.java | 46 ---- .../gui/preferences/PreviewTabView.java | 119 ++++---- .../gui/preferences/PreviewTabViewModel.java | 19 +- .../gui/preferences/TableColumnsTab.java | 5 +- .../jabref/gui/preferences/TablePrefsTab.java | 8 +- .../jabref/gui/preferences/XmpPrefsTab.java | 6 +- .../gui/push/PushToApplicationSettings.java | 2 + .../org/jabref/logic/net/ProxyRegisterer.java | 4 +- src/main/resources/l10n/JabRef_en.properties | 28 +- 41 files changed, 1200 insertions(+), 1046 deletions(-) create mode 100644 src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java create mode 100644 src/main/java/org/jabref/gui/preferences/AdvancedTab.fxml delete mode 100644 src/main/java/org/jabref/gui/preferences/AdvancedTab.java create mode 100644 src/main/java/org/jabref/gui/preferences/AdvancedTabView.java create mode 100644 src/main/java/org/jabref/gui/preferences/AdvancedTabViewModel.java delete mode 100644 src/main/java/org/jabref/gui/preferences/GroupsPrefsTab.java create mode 100644 src/main/java/org/jabref/gui/preferences/GroupsTab.fxml create mode 100644 src/main/java/org/jabref/gui/preferences/GroupsTabView.java create mode 100644 src/main/java/org/jabref/gui/preferences/GroupsTabViewModel.java delete mode 100644 src/main/java/org/jabref/gui/preferences/NetworkTab.java create mode 100644 src/main/java/org/jabref/gui/preferences/PreferencesTab.java delete mode 100644 src/main/java/org/jabref/gui/preferences/PrefsTab.java diff --git a/src/main/java/org/jabref/gui/Base.css b/src/main/java/org/jabref/gui/Base.css index c913bb5ad9e..5236268d894 100644 --- a/src/main/java/org/jabref/gui/Base.css +++ b/src/main/java/org/jabref/gui/Base.css @@ -1015,6 +1015,11 @@ We want to have a look that matches our icons in the tool-bar */ -fx-fill: -jr-warn; } +.warning-message { + -fx-fill: -jr-error; + -fx-text-fill: -jr-error; +} + .error-icon { -fx-text-fill: -jr-error; -fx-fill: -jr-error; diff --git a/src/main/java/org/jabref/gui/icon/IconTheme.java b/src/main/java/org/jabref/gui/icon/IconTheme.java index 6e9dca496b1..39e0ff48d0b 100644 --- a/src/main/java/org/jabref/gui/icon/IconTheme.java +++ b/src/main/java/org/jabref/gui/icon/IconTheme.java @@ -321,7 +321,8 @@ public enum JabRefIcons implements JabRefIcon { LATEX_FILE_DIRECTORY(MaterialDesignIcon.FOLDER_OUTLINE), LATEX_FILE(MaterialDesignIcon.FILE_OUTLINE), LATEX_COMMENT(MaterialDesignIcon.COMMENT_TEXT_OUTLINE), - LATEX_LINE(MaterialDesignIcon.FORMAT_LINE_SPACING); + LATEX_LINE(MaterialDesignIcon.FORMAT_LINE_SPACING), + PASSWORD_REVEALED(MaterialDesignIcon.EYE); private final JabRefIcon icon; diff --git a/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java b/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java new file mode 100644 index 00000000000..b957082890b --- /dev/null +++ b/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java @@ -0,0 +1,37 @@ +package org.jabref.gui.preferences; + +import java.util.List; + +import javax.inject.Inject; + +import javafx.scene.Node; +import javafx.scene.layout.VBox; + +import org.jabref.gui.DialogService; +import org.jabref.gui.util.TaskExecutor; +import org.jabref.preferences.JabRefPreferences; + +public abstract class AbstractPreferenceTabView extends VBox implements PreferencesTab { + + @Inject protected TaskExecutor taskExecutor; + @Inject protected DialogService dialogService; + + protected PreferenceTabViewModel viewModel; + + protected JabRefPreferences preferences; + + @Override + public Node getBuilder() { return this; } + + @Override + public void setValues() { viewModel.setValues(); } + + @Override + public void storeSettings() { viewModel.storeSettings(); } + + @Override + public boolean validateSettings() { return viewModel.validateSettings(); } + + @Override + public List getRestartWarnings() { return viewModel.getRestartWarnings(); } +} diff --git a/src/main/java/org/jabref/gui/preferences/AdvancedTab.fxml b/src/main/java/org/jabref/gui/preferences/AdvancedTab.fxml new file mode 100644 index 00000000000..ae24bdd63bd --- /dev/null +++ b/src/main/java/org/jabref/gui/preferences/AdvancedTab.fxml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + +