-
-
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
Observable preferences I (Internal [formerly Version], Groups, Xmp, AutoComplete) #8336
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5ee77d4
Refactored VersionPreferences to InternalPreferences and converted Gr…
calixtus f280c3c
Converted XmpPreferences to new observable prefs pattern
calixtus 8430ee6
Converted AutoCompletePreferences to new observable prefs pattern
calixtus 0f20583
Fixed tests
calixtus defb867
Fixed tests
calixtus c2f6e58
Fixed tests
calixtus 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
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
55 changes: 46 additions & 9 deletions
55
src/main/java/org/jabref/gui/groups/GroupsPreferences.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,36 +1,73 @@ | ||
package org.jabref.gui.groups; | ||
|
||
import javafx.beans.property.BooleanProperty; | ||
import javafx.beans.property.ObjectProperty; | ||
import javafx.beans.property.SimpleBooleanProperty; | ||
import javafx.beans.property.SimpleObjectProperty; | ||
|
||
public class GroupsPreferences { | ||
|
||
private final GroupViewMode groupViewMode; | ||
private final boolean shouldAutoAssignGroup; | ||
private final boolean shouldDisplayGroupCount; | ||
private final Character keywordSeparator; | ||
private final ObjectProperty<GroupViewMode> groupViewMode; | ||
private final BooleanProperty shouldAutoAssignGroup; | ||
private final BooleanProperty shouldDisplayGroupCount; | ||
private final ObjectProperty<Character> keywordSeparator; | ||
|
||
public GroupsPreferences(GroupViewMode groupViewMode, | ||
boolean shouldAutoAssignGroup, | ||
boolean shouldDisplayGroupCount, | ||
Character keywordSeparator) { | ||
ObjectProperty<Character> keywordSeparator) { | ||
|
||
this.groupViewMode = groupViewMode; | ||
this.shouldAutoAssignGroup = shouldAutoAssignGroup; | ||
this.shouldDisplayGroupCount = shouldDisplayGroupCount; | ||
this.groupViewMode = new SimpleObjectProperty<>(groupViewMode); | ||
this.shouldAutoAssignGroup = new SimpleBooleanProperty(shouldAutoAssignGroup); | ||
this.shouldDisplayGroupCount = new SimpleBooleanProperty(shouldDisplayGroupCount); | ||
this.keywordSeparator = keywordSeparator; | ||
} | ||
|
||
public GroupViewMode getGroupViewMode() { | ||
return groupViewMode.getValue(); | ||
} | ||
|
||
public ObjectProperty<GroupViewMode> groupViewModeProperty() { | ||
return groupViewMode; | ||
} | ||
|
||
public void setGroupViewMode(GroupViewMode groupViewMode) { | ||
this.groupViewMode.set(groupViewMode); | ||
} | ||
|
||
public boolean shouldAutoAssignGroup() { | ||
return shouldAutoAssignGroup.getValue(); | ||
} | ||
|
||
public BooleanProperty autoAssignGroupProperty() { | ||
return shouldAutoAssignGroup; | ||
} | ||
|
||
public void setAutoAssignGroup(boolean shouldAutoAssignGroup) { | ||
this.shouldAutoAssignGroup.set(shouldAutoAssignGroup); | ||
} | ||
|
||
public boolean shouldDisplayGroupCount() { | ||
return shouldDisplayGroupCount.getValue(); | ||
} | ||
|
||
public BooleanProperty displayGroupCountProperty() { | ||
return shouldDisplayGroupCount; | ||
} | ||
|
||
public Character getKeywordDelimiter() { | ||
public void setDisplayGroupCount(boolean shouldDisplayGroupCount) { | ||
this.shouldDisplayGroupCount.set(shouldDisplayGroupCount); | ||
} | ||
|
||
public Character getKeywordSeparator() { | ||
return keywordSeparator.getValue(); | ||
} | ||
|
||
public ObjectProperty<Character> keywordSeparatorProperty() { | ||
return keywordSeparator; | ||
} | ||
|
||
public void setKeywordSeparator(Character keywordSeparator) { | ||
this.keywordSeparator.set(keywordSeparator); | ||
} | ||
} |
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.
Why is this necessary? Please add a comment
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.
I cannot set the text to an empty value if the value is bound, instead it keeps the last calculated number of entries in
group.getHits()
or just0
, if the preference option to calculate the number of entries (which is very expensive in large databases) is deactivated. If the calculation of entries is disabled and you add or remove an entry from a group it would display the wrong number of entries.