From 87673ccd9775777e99582e9aca248750138ecbef Mon Sep 17 00:00:00 2001 From: Mihu Date: Tue, 13 Aug 2019 21:32:14 +0200 Subject: [PATCH 1/2] Fix issue 5152, tooltip and icon added to group cell --- .../jabref/gui/maintable/MainTableColumnFactory.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 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..f701ad820b3 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); @@ -77,6 +77,8 @@ public MainTableColumnFactory(BibDatabaseContext database, ColumnPreferences pre } public List> createColumns() { + + List> columns = new ArrayList<>(); columns.add(createGroupColumn()); @@ -116,8 +118,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) From 1da435509b99226c168ac0692e4400c8eed64b24 Mon Sep 17 00:00:00 2001 From: Mihu Date: Wed, 14 Aug 2019 17:40:19 +0200 Subject: [PATCH 2/2] -fixed minor issue with style (empty line) in MainTableColumnFactory -added key "Group color" into english language properties --- .../java/org/jabref/gui/maintable/MainTableColumnFactory.java | 4 ---- src/main/resources/l10n/JabRef_en.properties | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java b/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java index f701ad820b3..f3ae887b505 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java @@ -77,12 +77,8 @@ 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()); 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