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] 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