Skip to content

Commit

Permalink
Fix issue 5152, tooltip and icon added to group cell (#5191)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mmihuu authored and Siedlerchr committed Aug 18, 2019
1 parent 0316d76 commit 7388374
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -78,9 +78,7 @@ public MainTableColumnFactory(BibDatabaseContext database, ColumnPreferences pre

public List<TableColumn<BibEntryTableViewModel, ?>> createColumns() {
List<TableColumn<BibEntryTableViewModel, ?>> columns = new ArrayList<>();

columns.add(createGroupColumn());

// Add column for linked files
if (preferences.showFileColumn()) {
columns.add(createFileColumn());
Expand Down Expand Up @@ -116,8 +114,11 @@ public MainTableColumnFactory(BibDatabaseContext database, ColumnPreferences pre

private TableColumn<BibEntryTableViewModel, ?> createGroupColumn() {
TableColumn<BibEntryTableViewModel, List<AbstractGroup>> 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<BibEntryTableViewModel, List<AbstractGroup>>()
.withGraphic(this::createGroupColorRegion)
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7388374

Please sign in to comment.