CdmPreference pref = CdmPreference.NewTaxEditorInstance(EditorPreferencePredicate.NameDetailsView, value);
pref.setAllowOverride(isAllowOverride);
service.set(pref);
- PreferencesUtil.saveConfigToPrefernceStore(config);
+
return true;
}
public static final String COMMON_NAME_AREA_VOCABULARIES = "eu.etaxonomy.taxeditor.commonNames.areaVocabularies";
//Taxon Details View
- public static final String SHOW_SEC_DETAILS = "eu.etaxonomy.taxeditor.taxon.showSecDetails";
- public static final String DISABLE_SEC = "eu.etaxonomy.taxeditor.taxon.disableSec";
+// public static final String SHOW_SEC_DETAILS = "eu.etaxonomy.taxeditor.taxon.showSecDetails";
+// public static final String DISABLE_SEC = "eu.etaxonomy.taxeditor.taxon.disableSec";
//Name details view
- public static final String SHOW_SIMPLE_NAME_DETAILS_SECTION = "eu.etaxonomy.taxeditor.name.showSimpleName";
- public static final String SHOW_SIMPLE_NAME_DETAILS_TAXON = "eu.etaxonomy.taxeditor.name.showNameTaxon";
- public static final String SHOW_NAME_DETAILS_SECTION_LSID = "eu.etaxonomy.taxeditor.name.showNameLsid";
- public static final String SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION = "eu.etaxonomy.taxeditor.name.showNameNameApprobiation";
- public static final String SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE = "eu.etaxonomy.taxeditor.name.showNameNomenclaturalCode";
- public static final String SHOW_NAME_DETAILS_SECTION_RANK = "eu.etaxonomy.taxeditor.name.showNameRank";
- public static final String SHOW_NAME_DETAILS_SECTION_NAMECACHE = "eu.etaxonomy.taxeditor.name.showNameNameCache";
- public static final String SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS = "eu.etaxonomy.taxeditor.name.showNameAtomisedEpithets";
- public static final String SHOW_NAME_DETAILS_SECTION_AUTHORSHIP = "eu.etaxonomy.taxeditor.name.showNameAuthorship";
- public static final String SHOW_NAME_DETAILS_SECTION_HYBRID = "eu.etaxonomy.taxeditor.name.showNameHybrid";
- public static final String SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE = "eu.etaxonomy.taxeditor.name.showNameNomenclaturalReference";
- public static final String SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS = "eu.etaxonomy.taxeditor.name.showNameNomenclaturalStatus";
- public static final String SHOW_NAME_DETAILS_SECTION_PROTOLOGUE = "eu.etaxonomy.taxeditor.name.showNameProtologue";
- public static final String SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION = "eu.etaxonomy.taxeditor.name.showNameTypeDesignation";
- public static final String SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP = "eu.etaxonomy.taxeditor.name.showNameNameRelationship";
- public static final String SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE = "eu.etaxonomy.taxeditor.name.showNameAppendedPhrase";
- public static final String SHOW_NAME_DETAILS_SECTION_CACHE = "eu.etaxonomy.taxeditor.name.showNameCache";
- public static final String SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE = "eu.etaxonomy.taxeditor.name.showAuthorCache";
+// public static final String SHOW_SIMPLE_NAME_DETAILS_SECTION = "eu.etaxonomy.taxeditor.name.showSimpleName";
+// public static final String SHOW_SIMPLE_NAME_DETAILS_TAXON = "eu.etaxonomy.taxeditor.name.showNameTaxon";
+// public static final String SHOW_NAME_DETAILS_SECTION_LSID = "eu.etaxonomy.taxeditor.name.showNameLsid";
+// public static final String SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION = "eu.etaxonomy.taxeditor.name.showNameNameApprobiation";
+// public static final String SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE = "eu.etaxonomy.taxeditor.name.showNameNomenclaturalCode";
+// public static final String SHOW_NAME_DETAILS_SECTION_RANK = "eu.etaxonomy.taxeditor.name.showNameRank";
+// public static final String SHOW_NAME_DETAILS_SECTION_NAMECACHE = "eu.etaxonomy.taxeditor.name.showNameNameCache";
+// public static final String SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS = "eu.etaxonomy.taxeditor.name.showNameAtomisedEpithets";
+// public static final String SHOW_NAME_DETAILS_SECTION_AUTHORSHIP = "eu.etaxonomy.taxeditor.name.showNameAuthorship";
+// public static final String SHOW_NAME_DETAILS_SECTION_HYBRID = "eu.etaxonomy.taxeditor.name.showNameHybrid";
+// public static final String SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE = "eu.etaxonomy.taxeditor.name.showNameNomenclaturalReference";
+// public static final String SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS = "eu.etaxonomy.taxeditor.name.showNameNomenclaturalStatus";
+// public static final String SHOW_NAME_DETAILS_SECTION_PROTOLOGUE = "eu.etaxonomy.taxeditor.name.showNameProtologue";
+// public static final String SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION = "eu.etaxonomy.taxeditor.name.showNameTypeDesignation";
+// public static final String SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP = "eu.etaxonomy.taxeditor.name.showNameNameRelationship";
+// public static final String SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE = "eu.etaxonomy.taxeditor.name.showNameAppendedPhrase";
+// public static final String SHOW_NAME_DETAILS_SECTION_CACHE = "eu.etaxonomy.taxeditor.name.showNameCache";
+// public static final String SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE = "eu.etaxonomy.taxeditor.name.showAuthorCache";
public static final String ALLOW_OVERRIDE_NAME_DETAILS = "eu.etaxonomy.taxeditor.name.allowOverride";
public static final String OVERRIDE_NAME_DETAILS = "eu.etaxonomy.taxeditor.name.override";
protected boolean isAllowOverride;
private boolean isOverride;
+ private Button showSecDetail;
+ private Button secEnabled;
@Override
protected Control createContents(Composite parent) {
public void widgetSelected(SelectionEvent e) {
setApply(true);
isSimpleDetailsViewActivated = activateCheckButton.getSelection();
-
+ nameDetailsConfig.setSimpleDetailsViewActivated(isSimpleDetailsViewActivated);
dbSettings.setEnabled(isSimpleDetailsViewActivated);
PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated);
+ showSecDetail.setEnabled(isShowTaxon);
+ secEnabled.setEnabled(isShowTaxon);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowTaxon = showTaxon.getSelection();
-
+ nameDetailsConfig.setTaxonSectionActivated(isShowTaxon);
+ showSecDetail.setEnabled(isShowTaxon);
+ secEnabled.setEnabled(isShowTaxon);
}
});
- final Button showSecDetail = new Button(dbSettings, SWT.CHECK);
+ showSecDetail = new Button(dbSettings, SWT.CHECK);
showSecDetail.setText(Messages.NameDetailsViewComposite_Show_SecDetail);
+
isSecDetailsActivated = nameDetailsConfig.isSecDetailsActivated();
showSecDetail.setSelection(isSecDetailsActivated);
showSecDetail.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {
setApply(true);
isSecDetailsActivated = showSecDetail.getSelection();
-
+ nameDetailsConfig.setSecDetailsActivated(isSecDetailsActivated);
}
});
- final Button secEnabled = new Button(dbSettings, SWT.CHECK);
+ secEnabled = new Button(dbSettings, SWT.CHECK);
secEnabled.setText(Messages.NameDetailsViewComposite_SecEnabled);
+
isSecEnabled = nameDetailsConfig.isSecEnabled();
secEnabled.setSelection(isSecEnabled);
secEnabled.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {
setApply(true);
isSecEnabled = secEnabled.getSelection();
-
+ nameDetailsConfig.setSecEnabled(isSecEnabled);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowLSID = showLsid.getSelection();
-
+ nameDetailsConfig.setLSIDActivated(isShowLSID);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowNomenclaturalCode = showNomenclaturalCode.getSelection();
-
+ nameDetailsConfig.setNomenclaturalCodeActived(isShowNomenclaturalCode);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowNameCache = showNameCache.getSelection();
+ nameDetailsConfig.setNameCacheActivated(isShowNameCache);
}
});
final Button showAppendedPhrase = new Button(dbSettings, SWT.CHECK);
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowAppendedPhrase = showAppendedPhrase.getSelection();
+ nameDetailsConfig.setAppendedPhraseActivated(isShowAppendedPhrase);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowRank = showRank.getSelection();
+ nameDetailsConfig.setRankActivated(isShowRank);
}
});
final Button showEpithets = new Button(dbSettings, SWT.CHECK);
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowEpithets = showEpithets.getSelection();
+ nameDetailsConfig.setAtomisedEpithetsActivated(isShowEpithets);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowAuthorCache = showAuthorCache.getSelection();
+ nameDetailsConfig.setAuthorCacheActivated(isShowAuthorCache);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowAuthorship = showAuthorship.getSelection();
+ nameDetailsConfig.setAuthorshipSectionActivated(isShowAuthorship);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowNomenclaturalRef = showNomenclaturalRef.getSelection();
+ nameDetailsConfig.setNomenclaturalReferenceSectionActivated(isShowNomenclaturalRef);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowNomenclaturalStatus = showNomenclaturalStatus.getSelection();
+ nameDetailsConfig.setNomenclaturalStatusSectionActivated(isShowNomenclaturalStatus);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowProtologue = showProtologue.getSelection();
+ nameDetailsConfig.setProtologueActivated(isShowProtologue);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowTypeDesignation = showTypeDesignation.getSelection();
+ nameDetailsConfig.setTypeDesignationSectionActivated(isShowTypeDesignation);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowNameRelationship = showNameRelationship.getSelection();
+ nameDetailsConfig.setNameRelationsSectionActivated(isShowNameRelationship);
}
});
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowHybrid = showHybrid.getSelection();
+ nameDetailsConfig.setHybridActivated(isShowHybrid);
}
});
final Button showNameApprobiation = new Button(dbSettings, SWT.CHECK);
public void widgetSelected(SelectionEvent e) {
setApply(true);
isShowNameApprobiation = showNameApprobiation.getSelection();
+ nameDetailsConfig.setNameApprobiationActivated(isShowNameApprobiation);
}
});
PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated);
+ showSecDetail.setEnabled(isShowTaxon);
+ secEnabled.setEnabled(isShowTaxon);
}else{
final CLabel description = new CLabel(parent, SWT.NULL);
description.setText(Messages.NameDetailsViewConfiguration_description_not_available);
@Override
public boolean performOk() {
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON, isShowTaxon);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_SEC_DETAILS, isSecDetailsActivated);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.DISABLE_SEC, isSecEnabled);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION, isSimpleDetailsViewActivated);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION, isShowNameApprobiation);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID, isShowHybrid);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP, isShowNameRelationship);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION, isShowTypeDesignation);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE, isShowProtologue);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS, isShowNomenclaturalStatus);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE, isShowNomenclaturalRef);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP, isShowAuthorship);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE, isShowAuthorCache);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS, isShowEpithets);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK, isShowRank);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE, isShowAppendedPhrase);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE, isShowNameCache);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE, isShowNomenclaturalCode);
- PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID, isShowLSID);
+ if (nameDetailsConfig != null){
+ PreferencesUtil.setStringValue(EditorPreferencePredicate.NameDetailsView.getKey(), nameDetailsConfig.toString());
+ }
+
PreferencesUtil.setBooleanValue(IPreferenceKeys.OVERRIDE_NAME_DETAILS, isOverride);
return true;
//Name Details
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_HYBRID), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_LSID), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NAMECACHE), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_PROTOLOGUE), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_RANK), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION), true);
+ getPreferenceStore().setDefault(createPreferenceString(EditorPreferencePredicate.NameDetailsView.getKey()), new NameDetailsConfigurator(false).toString());
+
//Navigator preferences
getPreferenceStore().setDefault(createPreferenceString(SORT_NODES), NavigatorOrderEnum.RankAndNameOrder.getKey());
getPreferenceStore().setDefault(createPreferenceString(EditorPreferencePredicate.ShowNamespaceInSource.getKey()), Boolean.valueOf(EditorPreferencePredicate.ShowNamespaceInSource.getDefaultValue().toString()));
getPreferenceStore().setDefault(createPreferenceString(EditorPreferencePredicate.ShowIdInSource.getKey()), Boolean.valueOf(EditorPreferencePredicate.ShowIdInSource.getDefaultValue().toString()));
getPreferenceStore().setDefault(createPreferenceString(EditorPreferencePredicate.DisableMultiClassification.getKey()), Boolean.valueOf(EditorPreferencePredicate.DisableMultiClassification.getDefaultValue().toString()));
- getPreferenceStore().setDefault(createPreferenceString(DISABLE_SEC), false);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_SEC_DETAILS), true);
+
}
/**
NameDetailsConfigurator config = new NameDetailsConfigurator(true);
CdmPreferenceCache cache = CdmPreferenceCache.instance();
CdmPreference preference = null;
-
+ String value;
if (!local) {
preference = cache.get(EditorPreferencePredicate.NameDetailsView.getKey());
if (preference == null){
}
setBooleanValue(ALLOW_OVERRIDE_NAME_DETAILS, preference.isAllowOverride());
-
+ value = preference.getValue();
+ config.setAllowOverride(preference.isAllowOverride());
//the preference value is build like this:
//<section1>:true;<section2>:false....
+ }else{
+ value = getStringValue(EditorPreferencePredicate.NameDetailsView.getKey(), local);
+ }
+ String [] sections = value.split(";");
+ Map<String, Boolean> sectionMap = new HashMap<String, Boolean>();
+ String[] sectionValues;
+ for (String sectionValue: sections){
+ sectionValues = sectionValue.split(":");
+ sectionMap.put(sectionValues[0], Boolean.valueOf(sectionValues[1]));
+ }
- String value = preference.getValue();
- String [] sections = value.split(";");
- Map<String, Boolean> sectionMap = new HashMap<String, Boolean>();
- String[] sectionValues;
- for (String sectionValue: sections){
- sectionValues = sectionValue.split(":");
- sectionMap.put(sectionValues[0], Boolean.valueOf(sectionValues[1]));
- }
- config.setAllowOverride(preference.isAllowOverride());
- config.setSimpleDetailsViewActivated(getValue(sectionMap, "simpleViewActivated"));
+ config.setSimpleDetailsViewActivated(getValue(sectionMap, "simpleViewActivated"));
- // getPreferenceStore().setValue(SHOW_SIMPLE_NAME_DETAILS_TAXON,
- // (getValue(sectionMap, "taxon")));
config.setTaxonSectionActivated(getValue(sectionMap, "taxon"));
- config.setSecDetailsActivated(getValue(sectionMap, "taxon.SecEnabled"));
- config.setSecEnabled(getValue(sectionMap, "taxon.SecDetails"));
-
- // getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_LSID,
- // (getValue(sectionMap, "lsid")));
- config.setLSIDActivated(getValue(sectionMap, "lsid"));
+ config.setSecDetailsActivated(getValue(sectionMap, "taxon.SecEnabled"));
+ config.setSecEnabled(getValue(sectionMap, "taxon.SecDetails"));
- // getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE,
- // (getValue(sectionMap, "nc")));
- config.setNomenclaturalCodeActived(getValue(sectionMap, "nc"));
+ config.setLSIDActivated(getValue(sectionMap, "lsid"));
- // getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE,
- // (getValue(sectionMap, "ap")));
- config.setAppendedPhraseActivated(getValue(sectionMap, "ap"));
+ config.setNomenclaturalCodeActived(getValue(sectionMap, "nc"));
- // getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_RANK,
- // (getValue(sectionMap, "rank")));
- config.setRankActivated(getValue(sectionMap, "rank"));
+ config.setAppendedPhraseActivated(getValue(sectionMap, "ap"));
+ config.setRankActivated(getValue(sectionMap, "rank"));
- // getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS,
- // (getValue(sectionMap, "atomisedEpithets")));
- config.setAtomisedEpithetsActivated(getValue(sectionMap, "atomisedEpithets"));
+ config.setAtomisedEpithetsActivated(getValue(sectionMap, "atomisedEpithets"));
- // getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP,
- // (getValue(sectionMap,"author")));
- config.setAuthorshipSectionActivated(getValue(sectionMap,"author"));
+ config.setAuthorshipSectionActivated(getValue(sectionMap,"author"));
- // getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE,
- // (getValue(sectionMap, "nomRef")));
- config.setNomenclaturalReferenceSectionActivated(sectionMap.get("nomRef"));
+ config.setNomenclaturalReferenceSectionActivated(sectionMap.get("nomRef"));
- // getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS,
- // (getValue(sectionMap, "nomStat")));
- config.setNomenclaturalStatusSectionActivated(getValue(sectionMap, "nomStat"));
+ config.setNomenclaturalStatusSectionActivated(getValue(sectionMap, "nomStat"));
+ config.setProtologueActivated(getValue(sectionMap,"protologue"));
- // getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_PROTOLOGUE,
- // (getValue(sectionMap,"protologue")));
- config.setProtologueActivated(getValue(sectionMap,"protologue"));
+ config.setTypeDesignationSectionActivated(getValue(sectionMap,"typeDes"));
- // getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION,
- // (getValue(sectionMap,"typeDes")));
- config.setTypeDesignationSectionActivated(getValue(sectionMap,"typeDes"));
+ config.setNameRelationsSectionActivated(getValue(sectionMap,"nameRelation"));
- // getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP,
- // (getValue(sectionMap,"nameRelation")));
- config.setNameRelationsSectionActivated(getValue(sectionMap,"nameRelation"));
-
- // getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_HYBRID,
- // (getValue(sectionMap, "hybrid")));
config.setHybridActivated(getValue(sectionMap,"hybrid"));
- }else{
- config.setSimpleDetailsViewActivated(getBooleanValue(SHOW_SIMPLE_NAME_DETAILS_SECTION));
- config.setTaxonSectionActivated(getBooleanValue(SHOW_SIMPLE_NAME_DETAILS_TAXON));
- config.setSecDetailsActivated(getBooleanValue(SHOW_SEC_DETAILS));
- config.setSecEnabled(getBooleanValue(DISABLE_SEC));
- config.setLSIDActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_LSID));
- config.setNomenclaturalCodeActived(getBooleanValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE));
- config.setAppendedPhraseActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE));
- config.setRankActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_RANK));
- config.setAtomisedEpithetsActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS));
- config.setAuthorshipSectionActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP));
- config.setNomenclaturalReferenceSectionActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE));
- config.setNomenclaturalStatusSectionActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS));
- config.setProtologueActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_PROTOLOGUE));
- config.setTypeDesignationSectionActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION));
- config.setNameRelationsSectionActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP));
- config.setHybridActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_HYBRID));
- }
+
return config;
}
CdmPreference preference = null;
if (!local) {
- preference = CdmPreference.NewInstance(PreferenceSubject.NewDatabaseInstance(), EditorPreferencePredicate.NameDetailsView, config.toString());
+ preference = CdmPreference.NewInstance(PreferenceSubject.NewTaxEditorInstance(), EditorPreferencePredicate.NameDetailsView, config.toString());
setPreferenceToDB(preference);
}
- //also add to local preferences
- setBooleanValue(SHOW_SIMPLE_NAME_DETAILS_SECTION, config.isSimpleDetailsViewActivated());
- setBooleanValue(SHOW_SIMPLE_NAME_DETAILS_TAXON, config.isTaxonSectionActivated());
- setBooleanValue(SHOW_SEC_DETAILS, config.isSecDetailsActivated());
- setBooleanValue(DISABLE_SEC, config.isSecEnabled());
- setBooleanValue(SHOW_NAME_DETAILS_SECTION_LSID, config.isLSIDActivated());
- setBooleanValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE, config.isNomenclaturalCodeActived());
- setBooleanValue(SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE, config.isAppendedPhraseActivated());
- setBooleanValue(SHOW_NAME_DETAILS_SECTION_RANK, config.isRankActivated());
- setBooleanValue(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS, config.isAtomisedEpithetsActivated());
- setBooleanValue(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP, config.isAuthorshipSectionActivated());
- setBooleanValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE, config.isNomenclaturalReferenceSectionActivated());
- setBooleanValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS, config.isNomenclaturalStatusSectionActivated());
- setBooleanValue(SHOW_NAME_DETAILS_SECTION_PROTOLOGUE, config.isProtologueActivated());
- setBooleanValue(SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION, config.isTypeDesignationSectionActivated());
- setBooleanValue(SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP, config.isNameRelationsSectionActivated());
- setBooleanValue(SHOW_NAME_DETAILS_SECTION_HYBRID, config.isHybridActivated());
+ else{
+ setStringValue(EditorPreferencePredicate.NameDetailsView.getKey(), config.toString());
+ }
+
}
}
- /**
- *
- */
- public NameDetailsConfigurator createLocalNameDetailsViewConfig(boolean local) {
- NameDetailsConfigurator config = new NameDetailsConfigurator(true);
- if (local){
- config.setSimpleDetailsViewActivated(getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION));
- config.setAppendedPhraseActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE));
- config.setAtomisedEpithetsActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS));
- config.setAuthorshipSectionActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP));
- config.setLSIDActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID));
- config.setNameApprobiationActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION));
- config.setNameCacheActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_CACHE));
- config.setNameRelationsSectionActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP));
- config.setNomenclaturalCodeActived(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE));
- config.setNomenclaturalStatusSectionActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS));
- config.setNomenclaturalReferenceSectionActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE));
- config.setProtologueActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE));
- config.setRankActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK));
- config.setTaxonSectionActivated(getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON));
- config.setTypeDesignationSectionActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION));
- config.setHybridActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID));
- }else{
-
- }
-
- return config;
- }
-
-
- public static void saveConfigToPrefernceStore(NameDetailsConfigurator config) {
- setBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION,
- config.isSimpleDetailsViewActivated());
- setBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON, config.isTaxonSectionActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID, config.isLSIDActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE,
- config.isNomenclaturalCodeActived());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE,
- config.isNameCacheActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE,
- config.isAppendedPhraseActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK, config.isRankActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS,
- config.isAtomisedEpithetsActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE,
- config.isAuthorCacheActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP,
- config.isAuthorshipSectionActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE,
- config.isNomenclaturalReferenceSectionActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS,
- config.isNomenclaturalStatusSectionActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE,
- config.isProtologueActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION,
- config.isTypeDesignationSectionActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP,
- config.isNameRelationsSectionActivated());
- setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID,
- config.isHybridActivated());
-
- }
+
+
+
+
/**
* @return
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
-import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
*/
private static final EnumSet<CRUD> UPDATE = EnumSet.of(CRUD.UPDATE);
protected ToggleableTextElement toggleable_cache;
- protected boolean isAdvancedView ;
+
public AbstractIdentifiableEntityDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
super(formFactory, formElement);
updateToggleableCacheState();
- initIsAdvancedDetailsView();
+
}
toggleable_cache.setEnabled(getEntity() != null && CdmStore.currentAuthentiationHasPermission((CdmBase) getEntity(), UPDATE));
}
}
- protected void initIsAdvancedDetailsView(){
- if(PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
- isAdvancedView = false;
- } else{
- isAdvancedView = true;
- }
- }
+
}
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
import eu.etaxonomy.taxeditor.event.EventUtility;
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
@Override
protected void createControls(ICdmFormElement formElement,
INonViralName entity, int style) {
- if (isAdvancedView || PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE)){
+ NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
+ if (!config.isSimpleDetailsViewActivated() || config.isAuthorCacheActivated()){
toggleable_cache = formFactory.createToggleableTextField(this,
"Authorship Cache", entity.getAuthorshipCache(),
entity.isProtectedAuthorshipCache(), style);
}
NomenclaturalCode code = entity.getNomenclaturalCode();
- if (isAdvancedView || PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP)){
+ if (!config.isSimpleDetailsViewActivated() || config.isAuthorshipSectionActivated()){
selectionCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
getConversationHolder(),
formElement, "Author",
};
}
- if (isAdvancedView){
+ if (!config.isSimpleDetailsViewActivated()){
toggleable_cache = formFactory.createToggleableTextField(this, "Name Cache", nonViralName.getNameCache(), nonViralName.isProtectedNameCache(), style);
combo_rank = formFactory.createDefinedTermComboElement(TermType.Rank, this, "Rank", nonViralName.getRank(), style, comparator);
if (toggleable_cache != null){
toggleable_cache.setEnabled(getEntity().isProtectedNameCache());
- if (isAdvancedView){
+ if (!config.isSimpleDetailsViewActivated()){
if(isIrrelevant()){
setIrrelevant(isIrrelevant());
}else{
createBotanicalNameParts(formElement, nonViralName, style);
break;
case Fungi :
- if (isAdvancedView){
+ if (!config.isSimpleDetailsViewActivated()){
createFungusNameParts(formElement, nonViralName, style);
}
break;
private void createZoologicalNameParts(ICdmFormElement formElement, INonViralName nonViralName, int style){
IZoologicalName zoologicalName = (IZoologicalName) nonViralName;
- if (isAdvancedView){
+ if (!config.isSimpleDetailsViewActivated()){
text_breed = formFactory.createTextWithLabelElement(formElement, "Breed", zoologicalName.getBreed(), style);
}
}
import eu.etaxonomy.cdm.model.name.TaxonName;
import eu.etaxonomy.taxeditor.l10n.Messages;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
private HybridDetailSection section_hybrid;
private LsidWithExceptionLabelElement textLsid;
private TextWithLabelElement text_nameApprobation;
-
+ //protected boolean isAdvancedView ;
public NonViralNameDetailElement(CdmFormFactory formFactory,
ICdmFormElement formElement) {
super(formFactory, formElement);
- initIsAdvancedDetailsView();
}
/** {@inheritDoc} */
@Override
protected void createControls(ICdmFormElement formElement, final TaxonName entity, int style) {
+ NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
-
- if (isAdvancedView){
+ if (!config.isSimpleDetailsViewActivated() ){
toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
}else{
- if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_CACHE)){
+ if (config.isNameCacheActivated()){
toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
}
- if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE)){
+ if (config.isNomenclaturalCodeActived()){
combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
}
if (entity.getNameType().equals(NomenclaturalCode.ICNB)){
- if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION)){
+ if (config.isNameApprobiationActivated()){
text_nameApprobation = formFactory.createTextWithLabelElement(formElement, "Name Approbation", entity.getNameApprobation(),style);
}
}
- if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID)){
+ if (config.isLSIDActivated()){
textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style);
}
addElement(section_author);
// }
//TODO RL
- if (isAdvancedView || PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID)){
+ if (config.isHybridActivated()){
section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
addControl(section_hybrid);
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.persistence.hibernate.permission.Role;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
@Override
protected void createControls(ICdmFormElement formElement, TaxonBase entity, int style) {
+ NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
toggleable_cache = formFactory.createToggleableTextField(formElement,
"Title Cache", entity.getTitleCache(),
entity.isProtectedTitleCache(), style);
formElement, "Secundum",
entity.getSec(), EntitySelectionElement.ALL,
style);
- if (!PreferencesUtil.getBooleanValue(IPreferenceKeys.DISABLE_SEC)){
+ if (!config.isSecEnabled() && config.isSimpleDetailsViewActivated()){
selection_secundum.setEnabled(false);
}
- if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SEC_DETAILS)){
+ if (config.isSecDetailsActivated() || !config.isSimpleDetailsViewActivated()){
text_secundum_microreference = formFactory.createTextWithLabelElement(
formElement, "Detail",
entity.getSecMicroReference(),null,
import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.UsageTermCollection;
import eu.etaxonomy.taxeditor.ui.element.RootElement;
}
private void createTaxonSections(RootElement parent) {
+ NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
getSectionStyle(ParsingMessagesSection.class, true));
- if (!PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
+ if (!config.isSimpleDetailsViewActivated()){
TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
getSectionStyle(TaxonBaseDetailSection.class, true));
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
addPart(taxonBaseDetailSection);
}else{
- if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON)){
+ if (config.isTaxonSectionActivated()){
TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
getSectionStyle(TaxonBaseDetailSection.class, true));
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
.createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
getSectionStyle(NonViralNameDetailSection.class, true));
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- if (!PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE))){
+ if (!config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() && config.isNomenclaturalReferenceSectionActivated())){
NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
getSectionStyle(NomenclaturalReferenceDetailSection.class, true));
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
addPart(referenceDetailSection);
}
- if ( !PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS))){
+ if ( !config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() && config.isNomenclaturalStatusSectionActivated())){
NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
getSectionStyle(NomenclaturalStatusSection.class, true));
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
addPart(nomenclaturalStatusSection);
}
- if (!PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE))){
+ if ( !config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() && config.isProtologueActivated())){
ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, getSectionStyle(ProtologueSection.class));
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
addPart(protologSection);
}
- if (!PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION))){
+ if (!config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() && config.isTypeDesignationSectionActivated())){
TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, getSectionStyle(TypeDesignationSection.class));
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
addPart(typeDesignationSection);
}
- if (!PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP))){
+ if (!config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() &&config.isNameRelationsSectionActivated())){
NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, getSectionStyle(NameRelationshipDetailSection.class));
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
addPart(nameRelationshipSection);
if(refresh){
refresh();
-// setSelection(getSelection(), true);
}
}