1 package eu
.etaxonomy
.taxeditor
.preference
;
4 import org
.eclipse
.jface
.layout
.GridLayoutFactory
;
5 import org
.eclipse
.swt
.SWT
;
6 import org
.eclipse
.swt
.custom
.CLabel
;
7 import org
.eclipse
.swt
.events
.SelectionAdapter
;
8 import org
.eclipse
.swt
.events
.SelectionEvent
;
9 import org
.eclipse
.swt
.events
.SelectionListener
;
10 import org
.eclipse
.swt
.layout
.GridData
;
11 import org
.eclipse
.swt
.layout
.GridLayout
;
12 import org
.eclipse
.swt
.widgets
.Button
;
13 import org
.eclipse
.swt
.widgets
.Composite
;
14 import org
.eclipse
.swt
.widgets
.Control
;
15 import org
.eclipse
.swt
.widgets
.Label
;
17 import eu
.etaxonomy
.cdm
.model
.metadata
.CdmPreference
;
18 import eu
.etaxonomy
.cdm
.model
.metadata
.PreferencePredicate
;
19 import eu
.etaxonomy
.taxeditor
.l10n
.Messages
;
20 import eu
.etaxonomy
.taxeditor
.preference
.menu
.CdmPreferencePage
;
23 public class NameDetailsViewConfiguration
extends CdmPreferencePage
implements SelectionListener
{
25 boolean isUseLocalSettings
;
26 protected NameDetailsConfigurator nameDetailsConfig
;
27 Composite localSettings
;
29 protected CdmPreference nameDetailsPref
;
31 protected boolean isShowTaxon
;
32 protected boolean isShowNameApprobiation
;
33 protected boolean isShowHybrid
;
34 protected boolean isShowNameRelationship
;
35 protected boolean isShowNameRelationshipRuleConsidered
;
36 protected boolean isShowNameRelationshipRuleConsideredCodeEdition
;
37 protected boolean isShowTypeDesignation
;
38 protected boolean isShowProtologue
;
39 protected boolean isShowNomenclaturalStatus
;
40 protected boolean isShowNomenclaturalStatusRuleConsidered
;
41 protected boolean isShowNomenclaturalStatusRuleConsideredCodeEdition
;
42 protected boolean isShowNomenclaturalRef
;
43 protected boolean isShowAuthorship
;
44 protected boolean isShowInAuthors
;
45 protected boolean isShowAuthorCache
;
46 protected boolean isShowEpithets
;
47 protected boolean isShowRank
;
48 protected boolean isShowAppendedPhrase
;
49 protected boolean isShowNameCache
;
50 protected boolean isShowNomenclaturalCode
;
51 protected boolean isShowLSID
;
52 protected boolean isSecEnabled
;
53 protected boolean isSecDetailsActivated
;
55 protected boolean isAllowOverride
;
56 private boolean isOverride
= true;
57 private Button showSecDetail
;
58 private Button secEnabled
;
60 // protected Combo activateCheckButton;
61 protected Button allowLocalPreference
;
62 protected Button showTaxon
;
63 protected Button showLsid
;
64 protected Button showNomenclaturalCode
;
65 protected Button showNameCache
;
66 protected Button showAppendedPhrase
;
67 protected Button showRank
;
68 protected Button showEpithets
;
69 protected Button showAuthorCache
;
70 protected Button showAuthorship
;
71 protected Button showInAuthors
;
72 protected Button showNomenclaturalRef
;
73 protected Button showNomenclaturalStatus
;
74 protected Button showNomenclaturalStatusRuleConsidered
;
75 protected Button showNomenclaturalStatusRuleConsideredCodeEdition
;
76 protected Button showProtologue
;
77 protected Button showTypeDesignation
;
78 protected Button showNameRelationship
;
79 protected Button showNameRelationshipRuleConsidered
;
80 protected Button showNameRelationshipRuleConsideredCodeEdition
;
81 protected Button showHybrid
;
82 protected Button showNameApprobiation
;
87 protected Control
createContents(Composite parent
) {
89 if (isAllowOverride
|| isAdminPreference
){
91 final CLabel description
= new CLabel(parent
, SWT
.NULL
);
92 description
.setText(Messages
.NameDetailsViewConfiguration_description
);
94 Composite title
= createComposite(parent
);
95 if (isAdminPreference
){
96 allowLocalPreference
= createAllowOverrideButton(title
);
98 allowLocalPreference
.addSelectionListener(new SelectionAdapter(){
100 public void widgetSelected(SelectionEvent e
) {
102 isAllowOverride
= allowLocalPreference
.getSelection();
107 dbSettings
= new Composite(parent
, SWT
.NONE
);
108 dbSettings
.setLayout(new GridLayout());
110 Label separator
= new Label(dbSettings
, SWT
.HORIZONTAL
| SWT
.SEPARATOR
);
111 separator
.setLayoutData(new GridData(GridData
.FILL_HORIZONTAL
));
112 showTaxon
= new Button(dbSettings
, SWT
.CHECK
);
113 showTaxon
.setText(Messages
.NameDetailsViewComposite_Show_Taxon
);
114 showTaxon
.addSelectionListener(this);
115 isShowTaxon
= nameDetailsConfig
.isTaxonSectionActivated();
117 showTaxon
.addSelectionListener(new SelectionAdapter(){
119 public void widgetSelected(SelectionEvent e
) {
121 isShowTaxon
= showTaxon
.getSelection();
122 nameDetailsConfig
.setTaxonSectionActivated(isShowTaxon
);
123 showSecDetail
.setEnabled(isShowTaxon
);
124 secEnabled
.setEnabled(isShowTaxon
);
128 Composite taxonComp
= new Composite(dbSettings
, SWT
.NULL
);
130 GridLayoutFactory
.fillDefaults().applyTo(taxonComp
);
132 GridData data
= new GridData();
133 data
.horizontalIndent
= 10;
134 data
.horizontalAlignment
= SWT
.FILL
;
135 taxonComp
.setLayoutData(data
);
136 GridLayoutFactory
.fillDefaults().applyTo(taxonComp
);
137 secEnabled
= new Button(taxonComp
, SWT
.CHECK
);
138 secEnabled
.setText(Messages
.NameDetailsViewComposite_SecEnabled
);
139 secEnabled
.addSelectionListener(this);
140 isSecEnabled
= nameDetailsConfig
.isSecEnabled();
142 secEnabled
.addSelectionListener(new SelectionAdapter(){
144 public void widgetSelected(SelectionEvent e
) {
146 isSecEnabled
= secEnabled
.getSelection();
147 nameDetailsConfig
.setSecEnabled(isSecEnabled
);
150 showSecDetail
= new Button(taxonComp
, SWT
.CHECK
);
151 showSecDetail
.setText(Messages
.NameDetailsViewComposite_Show_SecDetail
);
152 showSecDetail
.addSelectionListener(this);
153 isSecDetailsActivated
= nameDetailsConfig
.isSecDetailsActivated();
155 showSecDetail
.addSelectionListener(new SelectionAdapter(){
157 public void widgetSelected(SelectionEvent e
) {
159 isSecDetailsActivated
= showSecDetail
.getSelection();
160 nameDetailsConfig
.setSecDetailsActivated(isSecDetailsActivated
);
164 showLsid
= new Button(dbSettings
, SWT
.CHECK
);
165 showLsid
.setText(Messages
.NameDetailsViewComposite_Show_LSID
);
166 isShowLSID
= nameDetailsConfig
.isLSIDActivated();
167 showLsid
.addSelectionListener(this);
168 showLsid
.addSelectionListener(new SelectionAdapter(){
170 public void widgetSelected(SelectionEvent e
) {
172 isShowLSID
= showLsid
.getSelection();
173 nameDetailsConfig
.setLSIDActivated(isShowLSID
);
177 showNomenclaturalCode
= new Button(dbSettings
, SWT
.CHECK
);
178 showNomenclaturalCode
.setText(Messages
.NameDetailsViewComposite_Show_NomenclaturalCode
);
179 isShowNomenclaturalCode
= nameDetailsConfig
.isNomenclaturalCodeActived();
180 showNomenclaturalCode
.addSelectionListener(this);
181 showNomenclaturalCode
.addSelectionListener(new SelectionAdapter(){
183 public void widgetSelected(SelectionEvent e
) {
185 isShowNomenclaturalCode
= showNomenclaturalCode
.getSelection();
186 nameDetailsConfig
.setNomenclaturalCodeActived(isShowNomenclaturalCode
);
190 showNameCache
= new Button(dbSettings
, SWT
.CHECK
);
191 showNameCache
.setText(Messages
.NameDetailsViewComposite_Show_NameCache
);
192 isShowNameCache
= nameDetailsConfig
.isNameCacheActivated();
193 showNameCache
.addSelectionListener(this);
194 showNameCache
.addSelectionListener(new SelectionAdapter(){
196 public void widgetSelected(SelectionEvent e
) {
198 isShowNameCache
= showNameCache
.getSelection();
199 nameDetailsConfig
.setNameCacheActivated(isShowNameCache
);
202 showAppendedPhrase
= new Button(dbSettings
, SWT
.CHECK
);
203 isShowAppendedPhrase
= nameDetailsConfig
.isAppendedPhraseActivated();
204 showAppendedPhrase
.setText(Messages
.NameDetailsViewComposite_Show_AppendedPhrase
);
205 showAppendedPhrase
.addSelectionListener(this);
206 showAppendedPhrase
.addSelectionListener(new SelectionAdapter(){
208 public void widgetSelected(SelectionEvent e
) {
210 isShowAppendedPhrase
= showAppendedPhrase
.getSelection();
211 nameDetailsConfig
.setAppendedPhraseActivated(isShowAppendedPhrase
);
215 showRank
= new Button(dbSettings
, SWT
.CHECK
);
216 isShowRank
= nameDetailsConfig
.isRankActivated();
217 showRank
.setText(Messages
.NameDetailsViewComposite_Show_Rank
);
218 showRank
.addSelectionListener(this);
219 showRank
.addSelectionListener(new SelectionAdapter(){
221 public void widgetSelected(SelectionEvent e
) {
223 isShowRank
= showRank
.getSelection();
224 nameDetailsConfig
.setRankActivated(isShowRank
);
227 showEpithets
= new Button(dbSettings
, SWT
.CHECK
);
228 isShowEpithets
= nameDetailsConfig
.isAtomisedEpithetsActivated();
229 showEpithets
.setText(Messages
.NameDetailsViewComposite_Show_AtomisedEpithets
);
230 showEpithets
.addSelectionListener(this);
231 showEpithets
.addSelectionListener(new SelectionAdapter(){
233 public void widgetSelected(SelectionEvent e
) {
235 isShowEpithets
= showEpithets
.getSelection();
236 nameDetailsConfig
.setAtomisedEpithetsActivated(isShowEpithets
);
240 showAuthorCache
= new Button(dbSettings
, SWT
.CHECK
);
241 isShowAuthorCache
= nameDetailsConfig
.isAuthorCacheActivated();
242 showAuthorCache
.setText(Messages
.NameDetailsViewComposite_Show_AuthorCache
);
243 showAuthorCache
.addSelectionListener(this);
244 showAuthorCache
.addSelectionListener(new SelectionAdapter(){
246 public void widgetSelected(SelectionEvent e
) {
248 isShowAuthorCache
= showAuthorCache
.getSelection();
249 nameDetailsConfig
.setAuthorCacheActivated(isShowAuthorCache
);
253 showAuthorship
= new Button(dbSettings
, SWT
.CHECK
);
254 isShowAuthorship
= nameDetailsConfig
.isAuthorshipSectionActivated();
255 showAuthorship
.setText(Messages
.NameDetailsViewComposite_Show_Author
);
256 showAuthorship
.addSelectionListener(this);
257 showAuthorship
.addSelectionListener(new SelectionAdapter(){
259 public void widgetSelected(SelectionEvent e
) {
261 isShowAuthorship
= showAuthorship
.getSelection();
262 nameDetailsConfig
.setAuthorshipSectionActivated(isShowAuthorship
);
263 showInAuthors
.setEnabled(isShowAuthorship
);
267 showInAuthors
= new Button(dbSettings
, SWT
.CHECK
);
268 isShowInAuthors
= nameDetailsConfig
.isInAuthorshipActivated();
269 showInAuthors
.setText(Messages
.NameDetailsViewComposite_Show_In_Author
);
270 showInAuthors
.setSelection(isShowInAuthors
);
271 showInAuthors
.addSelectionListener(this);
272 showInAuthors
.addSelectionListener(new SelectionAdapter(){
274 public void widgetSelected(SelectionEvent e
) {
276 isShowInAuthors
= showInAuthors
.getSelection();
277 nameDetailsConfig
.setInAuthorshipActivated(isShowInAuthors
);
280 showInAuthors
.setEnabled(isShowAuthorship
);
282 showNomenclaturalRef
= new Button(dbSettings
, SWT
.CHECK
);
283 isShowNomenclaturalRef
= nameDetailsConfig
.isNomenclaturalReferenceSectionActivated();
284 showNomenclaturalRef
.setText(Messages
.NameDetailsViewComposite_Show_NomenclaturalReference
);
285 showNomenclaturalRef
.addSelectionListener(this);
286 showNomenclaturalRef
.addSelectionListener(new SelectionAdapter(){
288 public void widgetSelected(SelectionEvent e
) {
290 isShowNomenclaturalRef
= showNomenclaturalRef
.getSelection();
291 nameDetailsConfig
.setNomenclaturalReferenceSectionActivated(isShowNomenclaturalRef
);
295 showNomenclaturalStatus
= new Button(dbSettings
, SWT
.CHECK
);
296 isShowNomenclaturalStatus
= nameDetailsConfig
.isNomenclaturalStatusSectionActivated();
297 showNomenclaturalStatus
.setText(Messages
.NameDetailsViewComposite_Show_NomenclaturalStatus
);
298 showNomenclaturalStatus
.addSelectionListener(this);
299 showNomenclaturalStatus
.addSelectionListener(new SelectionAdapter(){
301 public void widgetSelected(SelectionEvent e
) {
303 isShowNomenclaturalStatus
= showNomenclaturalStatus
.getSelection();
304 nameDetailsConfig
.setNomenclaturalStatusSectionActivated(isShowNomenclaturalStatus
);
306 showNomenclaturalStatusRuleConsidered
.setEnabled(isShowNomenclaturalStatus
);
307 if (isShowNomenclaturalStatus
){
308 showNomenclaturalStatusRuleConsideredCodeEdition
.setEnabled(isShowNomenclaturalStatusRuleConsidered
);
310 showNomenclaturalStatusRuleConsideredCodeEdition
.setEnabled(isShowNomenclaturalStatus
);
316 Composite nomenlaturalStatusComp
= new Composite(dbSettings
, SWT
.NULL
);
318 GridLayoutFactory
.fillDefaults().applyTo(nomenlaturalStatusComp
);
320 nomenlaturalStatusComp
.setLayoutData(data
);
322 showNomenclaturalStatusRuleConsidered
= new Button(nomenlaturalStatusComp
, SWT
.CHECK
);
323 isShowNomenclaturalStatusRuleConsidered
= nameDetailsConfig
.isNomenclaturalStatusRuleConsideredActivated();
324 showNomenclaturalStatusRuleConsidered
.setText(Messages
.NameDetailsViewComposite_Show_NomenclaturalStatus_RuleConsidered
);
325 showNomenclaturalStatusRuleConsidered
.addSelectionListener(this);
326 showNomenclaturalStatusRuleConsidered
.addSelectionListener(new SelectionAdapter(){
328 public void widgetSelected(SelectionEvent e
) {
330 isShowNomenclaturalStatusRuleConsidered
= showNomenclaturalStatusRuleConsidered
.getSelection();
331 nameDetailsConfig
.setNomenclaturalStatusRuleConsideredActivated(isShowNomenclaturalStatusRuleConsidered
);
332 showNomenclaturalStatusRuleConsideredCodeEdition
.setEnabled(isShowNomenclaturalStatusRuleConsidered
);
336 showNomenclaturalStatusRuleConsideredCodeEdition
= new Button(nomenlaturalStatusComp
, SWT
.CHECK
);
337 isShowNomenclaturalStatusRuleConsideredCodeEdition
= nameDetailsConfig
.isNomenclaturalStatusRuleConsideredCodeEditionActivated();
338 showNomenclaturalStatusRuleConsideredCodeEdition
.setText(Messages
.NameDetailsViewComposite_Show_NomenclaturalStatus_RuleConsideredCodeEdition
);
339 showNomenclaturalStatusRuleConsideredCodeEdition
.addSelectionListener(this);
340 showNomenclaturalStatusRuleConsideredCodeEdition
.addSelectionListener(new SelectionAdapter(){
342 public void widgetSelected(SelectionEvent e
) {
344 isShowNomenclaturalStatusRuleConsideredCodeEdition
= showNomenclaturalStatusRuleConsideredCodeEdition
.getSelection();
345 nameDetailsConfig
.setNomenclaturalStatusRuleConsideredCodeEditionActivated(isShowNomenclaturalStatusRuleConsideredCodeEdition
);
349 showProtologue
= new Button(dbSettings
, SWT
.CHECK
);
350 isShowProtologue
= nameDetailsConfig
.isProtologueActivated();
351 showProtologue
.setText(Messages
.NameDetailsViewComposite_Show_Protologue
);
352 showProtologue
.addSelectionListener(this);
353 showProtologue
.addSelectionListener(new SelectionAdapter(){
355 public void widgetSelected(SelectionEvent e
) {
357 isShowProtologue
= showProtologue
.getSelection();
358 nameDetailsConfig
.setProtologueActivated(isShowProtologue
);
362 showTypeDesignation
= new Button(dbSettings
, SWT
.CHECK
);
363 isShowTypeDesignation
= nameDetailsConfig
.isTypeDesignationSectionActivated();
364 showTypeDesignation
.setText(Messages
.NameDetailsViewComposite_Show_TypeDesignation
);
365 showTypeDesignation
.addSelectionListener(this);
366 showTypeDesignation
.addSelectionListener(new SelectionAdapter(){
368 public void widgetSelected(SelectionEvent e
) {
370 isShowTypeDesignation
= showTypeDesignation
.getSelection();
371 nameDetailsConfig
.setTypeDesignationSectionActivated(isShowTypeDesignation
);
376 showNameRelationship
= new Button(dbSettings
, SWT
.CHECK
);
377 isShowNameRelationship
= nameDetailsConfig
.isNameRelationsSectionActivated();
378 showNameRelationship
.setText(Messages
.NameDetailsViewComposite_Show_Namerelationships
);
379 showNameRelationship
.addSelectionListener(this);
380 showNameRelationship
.addSelectionListener(new SelectionAdapter(){
382 public void widgetSelected(SelectionEvent e
) {
384 isShowNameRelationship
= showNameRelationship
.getSelection();
385 nameDetailsConfig
.setNameRelationsSectionActivated(isShowNameRelationship
);
386 showNameRelationshipRuleConsidered
.setEnabled(isShowNameRelationship
);
387 if (isShowNameRelationship
){
388 showNameRelationshipRuleConsideredCodeEdition
.setEnabled(isShowNameRelationshipRuleConsidered
);
390 showNameRelationshipRuleConsideredCodeEdition
.setEnabled(isShowNameRelationship
);
396 Composite nameRelationComp
= new Composite(dbSettings
, SWT
.NULL
);
397 GridLayoutFactory
.fillDefaults().applyTo(nameRelationComp
);
398 nameRelationComp
.setLayoutData(data
);
400 showNameRelationshipRuleConsidered
= new Button(nameRelationComp
, SWT
.CHECK
);
401 isShowNameRelationshipRuleConsidered
= nameDetailsConfig
.isNameRelationsRuleConsideredActivated();
402 showNameRelationshipRuleConsidered
.setText(Messages
.NameDetailsViewComposite_Show_Namerelationships_RuleConsidered
);
403 showNameRelationshipRuleConsidered
.addSelectionListener(this);
404 showNameRelationshipRuleConsidered
.addSelectionListener(new SelectionAdapter(){
406 public void widgetSelected(SelectionEvent e
) {
408 isShowNameRelationshipRuleConsidered
= showNameRelationshipRuleConsidered
.getSelection();
409 nameDetailsConfig
.setNameRelationsRuleConsideredActivated(isShowNameRelationshipRuleConsidered
);
410 showNameRelationshipRuleConsideredCodeEdition
.setEnabled(isShowNameRelationshipRuleConsidered
);
415 showNameRelationshipRuleConsideredCodeEdition
= new Button(nameRelationComp
, SWT
.CHECK
);
416 isShowNameRelationshipRuleConsideredCodeEdition
= nameDetailsConfig
.isNameRelationsRuleConsideredCodeEditionActivated();
417 showNameRelationshipRuleConsideredCodeEdition
.setText(Messages
.NameDetailsViewComposite_Show_Namerelationships_RuleConsideredCodeEdition
);
418 showNameRelationshipRuleConsideredCodeEdition
.addSelectionListener(this);
419 showNameRelationshipRuleConsideredCodeEdition
.addSelectionListener(new SelectionAdapter(){
421 public void widgetSelected(SelectionEvent e
) {
423 isShowNameRelationshipRuleConsideredCodeEdition
= showNameRelationshipRuleConsideredCodeEdition
.getSelection();
424 nameDetailsConfig
.setNameRelationsRuleConsideredCodeEditionActivated(isShowNameRelationshipRuleConsideredCodeEdition
);
428 showHybrid
= new Button(dbSettings
, SWT
.CHECK
);
429 isShowHybrid
= nameDetailsConfig
.isHybridActivated();
430 showHybrid
.setText(Messages
.NameDetailsViewComposite_Show_Hybrid
);
431 showHybrid
.addSelectionListener(this);
432 showHybrid
.addSelectionListener(new SelectionAdapter(){
434 public void widgetSelected(SelectionEvent e
) {
436 isShowHybrid
= showHybrid
.getSelection();
437 nameDetailsConfig
.setHybridActivated(isShowHybrid
);
440 showNameApprobiation
= new Button(dbSettings
, SWT
.CHECK
);
441 isShowNameApprobiation
= nameDetailsConfig
.isNameApprobiationActivated();
442 showNameApprobiation
.setText(Messages
.NameDetailsViewComposite_Show_NameApprobiation
);
443 showNameApprobiation
.addSelectionListener(this);
444 showNameApprobiation
.addSelectionListener(new SelectionAdapter(){
446 public void widgetSelected(SelectionEvent e
) {
448 isShowNameApprobiation
= showNameApprobiation
.getSelection();
449 nameDetailsConfig
.setNameApprobiationActivated(isShowNameApprobiation
);
452 showSecDetail
.setEnabled(isShowTaxon
);
453 secEnabled
.setEnabled(isShowTaxon
);
455 setButtonSelections();
458 final CLabel description
= new CLabel(parent
, SWT
.NULL
);
459 description
.setText(Messages
.NameDetailsViewConfiguration_description_not_available
);
460 this.setDefaultButtonActivated(false);
470 public boolean performOk() {
473 PreferencesUtil
.setStringValue(PreferencePredicate
.NameDetailsView
.getKey(), nameDetailsConfig
.toString());
474 if (nameDetailsPref
== null || !nameDetailsConfig
.toString().equals(nameDetailsPref
.getValue())) {
475 PreferencesUtil
.setBooleanValue(PreferencesUtil
.prefOverrideKey(PreferencePredicate
.NameDetailsView
.getKey()), true);
478 PreferencesUtil
.setBooleanValue(PreferencesUtil
.prefOverrideKey(PreferencePredicate
.NameDetailsView
.getKey()), false);
482 PreferencesUtil
.firePreferencesChanged(this.getClass());
488 public void getValues(){
489 if (nameDetailsConfig
== null){
490 nameDetailsPref
= PreferencesUtil
.getPreferenceFromDB(PreferencePredicate
.NameDetailsView
);
491 isAdminPreference
= false;
492 isAllowOverride
= true;
493 if (nameDetailsPref
!= null){
494 isAllowOverride
= nameDetailsPref
.isAllowOverride();
497 isOverride
= PreferencesUtil
.getBooleanValue(PreferencesUtil
.prefOverrideKey(PreferencePredicate
.NameDetailsView
.getKey()), true) != null? PreferencesUtil
.getBooleanValue(PreferencesUtil
.prefOverrideKey(PreferencePredicate
.NameDetailsView
.getKey()), true): false;
499 nameDetailsConfig
= PreferencesUtil
.getPreferredNameDetailsConfiguration(true);
501 nameDetailsConfig
= PreferencesUtil
.getPreferredNameDetailsConfiguration(false);
503 if (nameDetailsConfig
== null){
504 nameDetailsConfig
= new NameDetailsConfigurator();
509 protected void setButtonSelections(){
510 if (isAdminPreference
){
511 allowLocalPreference
.setSelection(isAllowOverride
);
513 showTaxon
.setSelection(isShowTaxon
);
514 showLsid
.setSelection(isShowLSID
);
515 showNomenclaturalCode
.setSelection(isShowNomenclaturalCode
);
516 showNameCache
.setSelection(isShowNameCache
);
517 showAppendedPhrase
.setSelection(isShowAppendedPhrase
);
518 showRank
.setSelection(isShowRank
);
519 showEpithets
.setSelection(isShowEpithets
);
520 showAuthorCache
.setSelection(isShowAuthorCache
);
521 showAuthorship
.setSelection(isShowAuthorship
);
522 showInAuthors
.setSelection(isShowInAuthors
);
523 showNomenclaturalRef
.setSelection(isShowNomenclaturalRef
);
524 showNomenclaturalStatus
.setSelection(isShowNomenclaturalStatus
);
526 showNomenclaturalStatusRuleConsidered
.setSelection(isShowNomenclaturalStatusRuleConsidered
);
527 showNomenclaturalStatusRuleConsidered
.setEnabled(isShowNomenclaturalStatus
);
528 showNomenclaturalStatusRuleConsideredCodeEdition
.setSelection(isShowNomenclaturalStatusRuleConsideredCodeEdition
);
529 if (isShowNomenclaturalStatus
){
530 showNomenclaturalStatusRuleConsideredCodeEdition
.setEnabled(isShowNomenclaturalStatusRuleConsidered
);
532 showNomenclaturalStatusRuleConsideredCodeEdition
.setEnabled(isShowNomenclaturalStatus
);
535 showProtologue
.setSelection(isShowProtologue
);
536 showTypeDesignation
.setSelection(isShowTypeDesignation
);
537 showNameRelationship
.setSelection(isShowNameRelationship
);
538 showNameRelationshipRuleConsidered
.setSelection(isShowNameRelationshipRuleConsidered
);
539 showNameRelationshipRuleConsideredCodeEdition
.setSelection(isShowNameRelationshipRuleConsideredCodeEdition
);
540 showNameRelationshipRuleConsidered
.setEnabled(isShowNameRelationship
);
541 if (isShowNameRelationship
){
542 showNameRelationshipRuleConsideredCodeEdition
.setEnabled(isShowNameRelationshipRuleConsidered
);
544 showNameRelationshipRuleConsideredCodeEdition
.setEnabled(isShowNameRelationship
);
546 showHybrid
.setSelection(isShowHybrid
);
547 showNameApprobiation
.setSelection(isShowNameApprobiation
);
548 secEnabled
.setSelection(isSecEnabled
);
549 //secEnabled.setEnabled(isShowTaxon);
550 showSecDetail
.setSelection(isSecDetailsActivated
);
551 //showSecDetail.setEnabled(isShowTaxon);
556 protected void performDefaults() {
557 if (isAdminPreference
){
558 nameDetailsConfig
= new NameDetailsConfigurator();
560 nameDetailsConfig
= PreferencesUtil
.getPreferredNameDetailsConfiguration(false);
563 isShowAppendedPhrase
= nameDetailsConfig
.isAppendedPhraseActivated();
564 isShowEpithets
= nameDetailsConfig
.isAtomisedEpithetsActivated();
565 isShowAuthorship
= nameDetailsConfig
.isAuthorshipSectionActivated();
566 isShowInAuthors
= nameDetailsConfig
.isInAuthorshipActivated();
567 isShowAuthorCache
= nameDetailsConfig
.isAuthorCacheActivated();
568 isShowLSID
= nameDetailsConfig
.isLSIDActivated();
569 isShowNameApprobiation
= nameDetailsConfig
.isNameApprobiationActivated();
570 isShowNameCache
= nameDetailsConfig
.isNameCacheActivated();
571 isShowNameRelationship
= nameDetailsConfig
.isNameRelationsSectionActivated();
572 isShowNameRelationshipRuleConsidered
= nameDetailsConfig
.isNameRelationsRuleConsideredActivated();
573 isShowNameRelationshipRuleConsideredCodeEdition
= nameDetailsConfig
.isNameRelationsRuleConsideredCodeEditionActivated();
574 isShowNomenclaturalCode
= nameDetailsConfig
.isNomenclaturalCodeActived();
575 isShowNomenclaturalStatus
= nameDetailsConfig
.isNomenclaturalStatusSectionActivated();
576 isShowNomenclaturalStatusRuleConsidered
= nameDetailsConfig
.isNomenclaturalStatusRuleConsideredActivated();
577 isShowNomenclaturalStatusRuleConsideredCodeEdition
= nameDetailsConfig
.isNomenclaturalStatusRuleConsideredCodeEditionActivated();
578 isShowNomenclaturalRef
= nameDetailsConfig
.isNomenclaturalReferenceSectionActivated();
579 isShowProtologue
= nameDetailsConfig
.isProtologueActivated();
580 isShowRank
= nameDetailsConfig
.isRankActivated();
581 isShowTaxon
= nameDetailsConfig
.isTaxonSectionActivated();
582 isSecDetailsActivated
= nameDetailsConfig
.isSecDetailsActivated();
583 isSecEnabled
= nameDetailsConfig
.isSecEnabled();
584 isShowTypeDesignation
= nameDetailsConfig
.isTypeDesignationSectionActivated();
585 isShowHybrid
= nameDetailsConfig
.isHybridActivated();
586 // isSimpleDetailsViewActivated = null;
587 isAllowOverride
= true;
589 this.setButtonSelections();
590 // PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated!= null? isSimpleDetailsViewActivated:false);
591 // activateCheckButton.select(0);
593 super.performDefaults();
597 public void widgetSelected(SelectionEvent e
) {
598 if (e
.getSource() != getApplyButton() || e
.getSource() != getDefaultsButton()){
605 public void widgetDefaultSelected(SelectionEvent e
) {
606 // TODO Auto-generated method stub