diff --git a/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java b/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java index 39a38d9bee6..ec977536ecb 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java @@ -145,14 +145,15 @@ public static void setExactWidth(TableColumn column, double width) { column.setMaxWidth(width); } + /** + * Creates a column for the match category. + *

This column is always hidden but is used for sorting the table + * in the floating mode. The order of the {@link MatchCategory} enum constants + * determines the sorting order.

+ */ private TableColumn createMatchCategoryColumn(MainTableColumnModel columnModel) { TableColumn column = new MainTableColumn<>(columnModel); - Node header = new Text(Localization.lang("Match category")); - header.getStyleClass().add("mainTable-header"); - Tooltip.install(header, new Tooltip(MainTableColumnModel.Type.MATCH_CATEGORY.getDisplayName())); - column.setGraphic(header); column.setCellValueFactory(cellData -> cellData.getValue().matchCategory()); - new ValueTableCellFactory().withText(String::valueOf).install(column); column.setSortable(true); column.setSortType(TableColumn.SortType.ASCENDING); column.setVisible(false); diff --git a/src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java b/src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java index 90e239c79aa..568091ca4a8 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java @@ -35,7 +35,7 @@ public class MainTableColumnModel { private static final Logger LOGGER = LoggerFactory.getLogger(MainTableColumnModel.class); public enum Type { - MATCH_CATEGORY("match_category", Localization.lang("Match category")), + MATCH_CATEGORY("match_category"), // Not localized, because this column is always hidden INDEX("index", Localization.lang("Index")), EXTRAFILE("extrafile", Localization.lang("File type")), FILES("files", Localization.lang("Linked files")), diff --git a/src/main/java/org/jabref/gui/search/MatchCategory.java b/src/main/java/org/jabref/gui/search/MatchCategory.java index e67aa15fbca..c07fe9a30d9 100644 --- a/src/main/java/org/jabref/gui/search/MatchCategory.java +++ b/src/main/java/org/jabref/gui/search/MatchCategory.java @@ -1,5 +1,8 @@ package org.jabref.gui.search; +/** + * @implNote The order of constants in this enum is important because it is used for sorting the main table. + */ public enum MatchCategory { MATCHING_SEARCH_AND_GROUPS, MATCHING_SEARCH_NOT_GROUPS, diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 71fe067a711..6e6fa89f6a9 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -823,7 +823,6 @@ Character\ encoding\ '%0'\ is\ not\ supported.=Character encoding '%0' is not su Filter\ search\ results=Filter search results Filter\ by\ groups=Filter by groups Invert\ groups=Invert groups -Match\ category=Match category Scroll\ to\ previous\ match\ category=Scroll to previous match category Scroll\ to\ next\ match\ category=Scroll to next match category Search=Search