Merge branch 'release/4.10.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / preference / NameDetailsConfigurator.java
1 /**
2 * Copyright (C) 2016 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.taxeditor.preference;
10
11 /**
12 * @author k.luther
13 * @date 16.12.2016
14 *
15 */
16 public class NameDetailsConfigurator {
17
18 private boolean isSimpleDetailsViewActivated = true;
19
20 private boolean isTaxonSectionActivated = true;
21 private boolean isLSIDActivated = true;
22 private boolean isNomenclaturalCodeActived = true;
23 private boolean isNameCacheActivated = true;
24 private boolean isAppendedPhraseActivated = true;
25 private boolean isRankActivated = true;
26 private boolean isAtomisedEpithetsActivated = true;
27 private boolean isAuthorshipSectionActivated = true;
28 private boolean isAuthorCacheActivated = true;
29 private boolean isNomenclaturalReferenceSectionActivated = true;
30 private boolean isNomenclaturalStatusSectionActivated = true;
31 private boolean isTypeDesignationSectionActivated = true;
32 private boolean isNameRelationsSectionActivated = true;
33 private boolean isProtologueActivated = true;
34 private boolean isHybridActivated = true;
35
36 private boolean isNameApprobiationActivated = true;
37
38 public NameDetailsConfigurator(boolean isSimpleDetailsViewActivated){
39 this.isSimpleDetailsViewActivated = isSimpleDetailsViewActivated;
40 }
41
42 public boolean isSimpleDetailsViewActivated() {
43 return isSimpleDetailsViewActivated;
44 }
45
46 public void setSimpleDetailsViewActivated(boolean isSimpleDetailsViewActivated) {
47 this.isSimpleDetailsViewActivated = isSimpleDetailsViewActivated;
48 }
49
50 public boolean isTaxonSectionActivated() {
51 return isTaxonSectionActivated;
52 }
53
54 public void setTaxonSectionActivated(boolean isTaxonSectionActivated) {
55 this.isTaxonSectionActivated = isTaxonSectionActivated;
56 }
57
58 public boolean isLSIDActivated() {
59 return isLSIDActivated;
60 }
61
62 public void setLSIDActivated(boolean isLSIDActivated) {
63 this.isLSIDActivated = isLSIDActivated;
64 }
65
66 public boolean isNomenclaturalCodeActived() {
67 return isNomenclaturalCodeActived;
68 }
69
70 public void setNomenclaturalCodeActived(boolean isNomenclaturalCodeActived) {
71 this.isNomenclaturalCodeActived = isNomenclaturalCodeActived;
72 }
73
74 public boolean isNameCacheActivated() {
75 return isNameCacheActivated;
76 }
77
78 public void setNameCacheActivated(boolean isNameCacheActivated) {
79 this.isNameCacheActivated = isNameCacheActivated;
80 }
81
82 public boolean isAppendedPhraseActivated() {
83 return isAppendedPhraseActivated;
84 }
85
86 public void setAppendedPhraseActivated(boolean isAppendedPhraseActivated) {
87 this.isAppendedPhraseActivated = isAppendedPhraseActivated;
88 }
89
90 public boolean isRankActivated() {
91 return isRankActivated;
92 }
93
94 public void setRankActivated(boolean isRankActivated) {
95 this.isRankActivated = isRankActivated;
96 }
97
98 public boolean isAtomisedEpithetsActivated() {
99 return isAtomisedEpithetsActivated;
100 }
101
102 public void setAtomisedEpithetsActivated(boolean isAtomisedEpithetsActivated) {
103 this.isAtomisedEpithetsActivated = isAtomisedEpithetsActivated;
104 }
105
106 public boolean isAuthorshipSectionActivated() {
107 return isAuthorshipSectionActivated;
108 }
109
110 public void setAuthorshipSectionActivated(boolean isAuthorshipSectionActivated) {
111 this.isAuthorshipSectionActivated = isAuthorshipSectionActivated;
112 }
113
114 public boolean isNomenclaturalReferenceSectionActivated() {
115 return isNomenclaturalReferenceSectionActivated;
116 }
117
118 public void setNomenclaturalReferenceSectionActivated(boolean isNomenclaturalReferenceSectionActivated) {
119 this.isNomenclaturalReferenceSectionActivated = isNomenclaturalReferenceSectionActivated;
120 }
121
122 public boolean isNomenclaturalStatusSectionActivated() {
123 return isNomenclaturalStatusSectionActivated;
124 }
125
126 public void setNomenclaturalStatusSectionActivated(boolean isNomenclaturalStatusSectionActivated) {
127 this.isNomenclaturalStatusSectionActivated = isNomenclaturalStatusSectionActivated;
128 }
129
130 public boolean isTypeDesignationSectionActivated() {
131 return isTypeDesignationSectionActivated;
132 }
133
134 public void setTypeDesignationSectionActivated(boolean isTypeDesignationSectionActivated) {
135 this.isTypeDesignationSectionActivated = isTypeDesignationSectionActivated;
136 }
137
138 public boolean isNameRelationsSectionActivated() {
139 return isNameRelationsSectionActivated;
140 }
141
142 public void setNameRelationsSectionActivated(boolean isNameRelationsSectionActivated) {
143 this.isNameRelationsSectionActivated = isNameRelationsSectionActivated;
144 }
145
146 /**
147 * @return the isProtologueActivated
148 */
149 public boolean isProtologueActivated() {
150 return isProtologueActivated;
151 }
152
153 /**
154 * @param isProtologueActivated the isProtologueActivated to set
155 */
156 public void setProtologueActivated(boolean isProtologueActivated) {
157 this.isProtologueActivated = isProtologueActivated;
158 }
159
160 @Override
161 public String toString(){
162 StringBuffer result = new StringBuffer();
163 //the preference value is build like this:
164 //<section1>:true;<section2>:false....
165 result.append("simpleViewActivated");
166 result.append(":");
167 result.append(this.isSimpleDetailsViewActivated);
168 result.append(";");
169
170 result.append("taxon");
171 result.append(":");
172 result.append(this.isTaxonSectionActivated);
173 result.append(";");
174
175 result.append("lsid");
176 result.append(":");
177 result.append(this.isLSIDActivated());
178 result.append(";");
179 result.append("nameApproviation");
180 result.append(":");
181 result.append(this.isNameApprobiationActivated());
182 result.append(";");
183 result.append("nc");
184 result.append(":");
185 result.append(this.isNomenclaturalCodeActived());
186 result.append(";");
187 result.append("ap");
188 result.append(":");
189 result.append(this.isAppendedPhraseActivated());
190 result.append(";");
191 result.append("rank");
192 result.append(":");
193 result.append(this.isRankActivated());
194 result.append(";");
195 result.append("author");
196 result.append(":");
197 result.append(this.isAuthorshipSectionActivated());
198 result.append(";");
199 result.append("atomisedEpithets");
200 result.append(":");
201 result.append(this.isAtomisedEpithetsActivated());
202 result.append(";");
203 result.append("nomRef");
204 result.append(":");
205 result.append(this.isNomenclaturalReferenceSectionActivated());
206 result.append(";");
207 result.append("nomStat");
208 result.append(":");
209 result.append(this.isNomenclaturalStatusSectionActivated());
210 result.append(";");
211 result.append("protologue");
212 result.append(":");
213 result.append(this.isProtologueActivated());
214 result.append(";");
215 result.append("typeDes");
216 result.append(":");
217 result.append(this.isTypeDesignationSectionActivated());
218 result.append(";");
219 result.append("nameRelation");
220 result.append(":");
221 result.append(this.isNameRelationsSectionActivated());
222 result.append(";");
223 result.append("hybrid");
224 result.append(":");
225 result.append(this.isHybridActivated());
226
227 return result.toString();
228 }
229
230
231
232 /**
233 * @return the isAuthorCacheActivated
234 */
235 public boolean isAuthorCacheActivated() {
236 return isAuthorCacheActivated;
237 }
238
239 /**
240 * @param isAuthorCacheActivated the isAuthorCacheActivated to set
241 */
242 public void setAuthorCacheActivated(boolean isAuthorCacheActivated) {
243 this.isAuthorCacheActivated = isAuthorCacheActivated;
244 }
245
246 public boolean isHybridActivated() {
247 return isHybridActivated;
248 }
249
250 public void setHybridActivated(boolean isHybridActivated) {
251 this.isHybridActivated = isHybridActivated;
252 }
253
254 public void setNameApprobiationActivated(boolean isNameApprobiationActivated) {
255 this.isNameApprobiationActivated = isNameApprobiationActivated;
256
257 }
258 public boolean isNameApprobiationActivated() {
259 return isNameApprobiationActivated;
260
261 }
262
263 }