-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add button-icon for union/intersection in the groups side panel #3954
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8b9e6a9
Add button for union/intersection in the groups side panel
Siedlerchr 1a72f7d
add method for getting addtionalHeaderButtons
Siedlerchr 04ed6b3
remove uncommented code
Siedlerchr 971f384
fix checkstyle
Siedlerchr 4e3757b
Add group intersection and union icons
halirutan c2ec176
add tooltips for side pane and groups pane
Siedlerchr 099d579
Merge remote-tracking branch 'upstream/maintable-beta' into unioninte…
Siedlerchr ae1a438
Extract get graphics and tooltip to new class
Siedlerchr 9244e85
Merge remote-tracking branch 'upstream/maintable-beta' into unioninte…
Siedlerchr 17a4c77
refactor and extract icon method to view model
Siedlerchr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The texts seem to be interchanged by mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it's right. As the tooltip should indicate what happens when you press the button,
If you are in union mode currently -> togle intersection
If you are in intersection mode -> toggle union