-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A single class which handles the preference for highlighting matching…
… groups.
- Loading branch information
1 parent
ba94661
commit 0f9a9e9
Showing
3 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/main/java/net/sf/jabref/HighlightMatchingGroupPreferences.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package net.sf.jabref; | ||
|
||
public class HighlightMatchingGroupPreferences { | ||
|
||
public static final String ALL = "all"; | ||
public static final String ANY = "any"; | ||
public static final String DISABLED = ""; | ||
|
||
private final JabRefPreferences preferences; | ||
|
||
public HighlightMatchingGroupPreferences(JabRefPreferences preferences) { | ||
this.preferences = preferences; | ||
} | ||
|
||
public boolean isAll() { | ||
return ALL.equals(preferences.get(JabRefPreferences.HIGHLIGHT_GROUPS_MATCHING)); | ||
} | ||
|
||
public boolean isAny() { | ||
return ANY.equals(preferences.get(JabRefPreferences.HIGHLIGHT_GROUPS_MATCHING)); | ||
} | ||
|
||
public boolean isDisabled() { | ||
return !isAll() && !isAny(); | ||
} | ||
|
||
public void setToAll() { | ||
preferences.put(JabRefPreferences.HIGHLIGHT_GROUPS_MATCHING, ALL); | ||
} | ||
|
||
public void setToAny() { | ||
preferences.put(JabRefPreferences.HIGHLIGHT_GROUPS_MATCHING, ANY); | ||
} | ||
|
||
public void setToDisabled() { | ||
preferences.put(JabRefPreferences.HIGHLIGHT_GROUPS_MATCHING, DISABLED); | ||
} | ||
|
||
} |
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