-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add button-icon for union/intersection in the groups side panel (#3954)
* Add button for union/intersection in the groups side panel Fix display ofs state in preferences * add method for getting addtionalHeaderButtons create enum with icons change booleans to enum remove duplicated code remove old prefs * remove uncommented code * fix checkstyle * Add group intersection and union icons * add tooltips for side pane and groups pane * Extract get graphics and tooltip to new class return headerbuttons as list * refactor and extract icon method to view model make prefs private
- Loading branch information
1 parent
6608b2b
commit 1db6336
Showing
12 changed files
with
160 additions
and
33 deletions.
There are no files selected for viewing
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
34 changes: 34 additions & 0 deletions
34
src/main/java/org/jabref/gui/groups/GroupModeViewModel.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,34 @@ | ||
package org.jabref.gui.groups; | ||
|
||
import javafx.scene.Node; | ||
import javafx.scene.control.Tooltip; | ||
|
||
import org.jabref.gui.icon.IconTheme.JabRefIcons; | ||
import org.jabref.logic.l10n.Localization; | ||
|
||
public class GroupModeViewModel { | ||
|
||
public static Tooltip getUnionIntersectionTooltip(GroupViewMode mode) { | ||
if (mode == GroupViewMode.UNION) { | ||
return new Tooltip(Localization.lang("Toogle intersection")); | ||
} | ||
if (mode == GroupViewMode.INTERSECTION) { | ||
return new Tooltip(Localization.lang("Toogle union")); | ||
} | ||
return new Tooltip(); | ||
|
||
} | ||
|
||
public static Node getUnionIntersectionGraphic(GroupViewMode mode) { | ||
|
||
if (mode == GroupViewMode.UNION) { | ||
return JabRefIcons.GROUP_UNION.getGraphicNode(); | ||
} | ||
if (mode == GroupViewMode.INTERSECTION) { | ||
return JabRefIcons.GROUP_INTERSECTION.getGraphicNode(); | ||
} | ||
//as there is no concept like an empty node/icon, we return simply the other icon | ||
return JabRefIcons.GROUP_INTERSECTION.getGraphicNode(); | ||
|
||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.jabref.gui.groups; | ||
|
||
public enum GroupViewMode { | ||
|
||
INTERSECTION, | ||
UNION, | ||
|
||
} |
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
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
Oops, something went wrong.