-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
248995f
commit c7431f7
Showing
3 changed files
with
21 additions
and
17 deletions.
There are no files selected for viewing
19 changes: 12 additions & 7 deletions
19
src/main/java/org/jabref/gui/search/SearchDisplayMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
package org.jabref.gui.search; | ||
|
||
import java.util.function.Supplier; | ||
|
||
import org.jabref.logic.l10n.Localization; | ||
|
||
/** | ||
* Collects the possible search modes | ||
*/ | ||
public enum SearchDisplayMode { | ||
|
||
FLOAT(Localization.lang("Float"), Localization.lang("Gray out non-hits")), | ||
FILTER(Localization.lang("Filter"), Localization.lang("Hide non-hits")); | ||
FLOAT(() -> Localization.lang("Float"), () -> Localization.lang("Gray out non-hits")), | ||
FILTER(() -> Localization.lang("Filter"), () -> Localization.lang("Hide non-hits")); | ||
|
||
private final String displayName; | ||
private final String toolTipText; | ||
private final Supplier<String> displayName; | ||
private final Supplier<String> toolTipText; | ||
|
||
SearchDisplayMode(String displayName, String toolTipText) { | ||
/** | ||
* We have to use supplier for the localized text so that language changes are correctly reflected. | ||
*/ | ||
SearchDisplayMode(Supplier<String> displayName, Supplier<String> toolTipText) { | ||
this.displayName = displayName; | ||
this.toolTipText = toolTipText; | ||
} | ||
|
||
public String getDisplayName() { | ||
return displayName; | ||
return displayName.get(); | ||
} | ||
|
||
public String getToolTipText() { | ||
return toolTipText; | ||
return toolTipText.get(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters