forked from JabRef/jabref
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNameDisplayPreferences.java
More file actions
64 lines (49 loc) · 1.85 KB
/
NameDisplayPreferences.java
File metadata and controls
64 lines (49 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package org.jabref.gui.maintable;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
public class NameDisplayPreferences {
public enum DisplayStyle {
NATBIB, AS_IS, FIRSTNAME_LASTNAME, LASTNAME_FIRSTNAME
}
public enum AbbreviationStyle {
NONE, LASTNAME_ONLY, FULL
}
private final ObjectProperty<DisplayStyle> displayStyle = new SimpleObjectProperty<>();
private final ObjectProperty<AbbreviationStyle> abbreviationStyle = new SimpleObjectProperty<>();
public NameDisplayPreferences(DisplayStyle displayStyle,
AbbreviationStyle abbreviationStyle) {
this.displayStyle.set(displayStyle);
this.abbreviationStyle.set(abbreviationStyle);
}
private NameDisplayPreferences() {
this(
DisplayStyle.NATBIB,
AbbreviationStyle.FULL
);
}
public static NameDisplayPreferences getDefault() {
return new NameDisplayPreferences();
}
public void setAll(NameDisplayPreferences preferences) {
this.displayStyle.set(preferences.displayStyle.get());
this.abbreviationStyle.set(preferences.abbreviationStyle.get());
}
public DisplayStyle getDisplayStyle() {
return displayStyle.get();
}
public ObjectProperty<DisplayStyle> displayStyleProperty() {
return displayStyle;
}
public void setDisplayStyle(DisplayStyle displayStyle) {
this.displayStyle.set(displayStyle);
}
public AbbreviationStyle getAbbreviationStyle() {
return abbreviationStyle.get();
}
public ObjectProperty<AbbreviationStyle> abbreviationStyleProperty() {
return abbreviationStyle;
}
public void setAbbreviationStyle(AbbreviationStyle abbreviationStyle) {
this.abbreviationStyle.set(abbreviationStyle);
}
}