-
-
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.
Observable preferences I (Internal [formerly Version], Groups, Xmp, A…
…utoComplete) (#8336) * Refactored VersionPreferences to InternalPreferences and converted GroupsPreferences to new prefs model * Converted XmpPreferences to new observable prefs pattern * Converted AutoCompletePreferences to new observable prefs pattern * Fixed tests * Fixed tests * Fixed tests
- Loading branch information
Showing
31 changed files
with
482 additions
and
341 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
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.