import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
+import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
+import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
-import eu.etaxonomy.taxeditor.Messages;
+import eu.etaxonomy.taxeditor.l10n.Messages;
import eu.etaxonomy.taxeditor.model.NomenclaturalCodeHelper;
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
* @date 01.11.2016
*
*/
-public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
+public class DatabasePreferencesPage extends AbstractPreferenceWizard implements IWizardPage{
CdmPreference preferedNomenclaturalCode;
NameDetailsConfigurator config ;
CdmPreference determinationOnlyForFieldUnitsPreference;
CdmPreference showCollectingAreaInGeneralSectionPreference;
CdmPreference showTaxonAssociationsPreference;
+ CdmPreference setPublishFlagAsDefault;
-
- TabFolder tabFolder;
-
- IPreferenceStore preferenceStore;
- Composite composite;
boolean isSimpleDetailsViewActivated;
+
Composite child ;
+ NameDetailsViewComposite nameDetailsConfig;
+ protected NameDetailsViewComposite getNameDetailsConfig() {
+ return nameDetailsConfig;
+ }
- private Combo nomenclaturalCodeCombo;
- private Label nomenclaturalCodeLabel;
+ String selectedPreferenceKey = null;
-// private UriWithLabelElement nomenclaturalCodeCombo;
-// private Label nomenclaturalCodeLabel;
+ ListComponent biocaseProviderList;
+ Abcd206ImportConfigurator abcdImportConfigurator;
String[][] labelAndValues;
super(pageName);
this.preferedNomenclaturalCode = PreferencesUtil.setPreferredNomenclaturalCode(null, false);
this.config = PreferencesUtil.setPreferredNameDetailsConfiguration( false);
- setPreferenceStore(PreferencesUtil.getPreferenceStore());
-
- }
-
- protected void setPreferenceStore(IPreferenceStore store){
- this.preferenceStore = store;
- }
-
-
-
-
- /***
- * Adds a tab to the page.
- * @param text the tab label
- */
- public Composite addTab(String text) {
- if (tabFolder == null){
- // initialize tab folder
- if (composite == null) {
- composite = new Composite(getShell(), SWT.NONE);
- }
- tabFolder = new TabFolder(composite, SWT.NONE);
- tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
+ if (config == null){
+ config = new NameDetailsConfigurator(false);
}
- TabItem item = new TabItem(tabFolder, SWT.NONE);
- item.setText(text);
-
- Composite currentTab = new Composite(tabFolder, SWT.NULL);
- GridLayout layout = new GridLayout();
- currentTab.setLayout(layout);
- currentTab.setFont(composite.getFont());
- currentTab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- item.setControl(currentTab);
- return currentTab;
- }
-
- /**
- * @param tabFolder
- */
- private void createNameDetailsConfiguration(Composite parent) {
- if (composite == null){
- composite = parent;
- }
- composite = addTab(Messages.DatabasePreferencesPage_details_view_configuration);
-// TabItem tbtmNameDetailsConfiguration = new TabItem(tabFolder, SWT.NONE);
-// Composite c2 = new Composite(tabFolder, SWT.BORDER);
-// c2.setLayout(new GridLayout(1, true));
-// tbtmNameDetailsConfiguration.setControl(c2);
- // composite.setLayout(new GridLayout(1, true));
- config = new NameDetailsConfigurator(true);
-
- // Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- isSimpleDetailsViewActivated= PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION);
- final Button activateCheckButton = new Button(composite, SWT.CHECK);
- activateCheckButton.setText(Messages.DatabasePreferencesPage_show_only_simple_details_view);
- activateCheckButton.setSelection(isSimpleDetailsViewActivated);
- activateCheckButton.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- isSimpleDetailsViewActivated = activateCheckButton.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION, isSimpleDetailsViewActivated);
- if(isSimpleDetailsViewActivated){
- child.setVisible(true);
- child.setEnabled(true);
- }else{
- child.setVisible(false);
- child.setEnabled(false);
- }
- }
- });
-
- child = new Composite(composite, SWT.NULL);
- child.setLayout(new GridLayout());
- child.setVisible(isSimpleDetailsViewActivated);
-
- final Button showTaxon = new Button(child, SWT.CHECK);
- boolean isShowTaxon = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON);
- showTaxon.setText(Messages.DatabasePreferencesPage_show_taxon);
- showTaxon.setSelection(isShowTaxon);
- showTaxon.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowTaxon = showTaxon.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON, isShowTaxon);
- }
- });
-
- final Button showLsid = new Button(child, SWT.CHECK);
- boolean isShowLSID = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID);
- showLsid.setText(Messages.DatabasePreferencesPage_show_lsid);
- showLsid.setSelection(isShowLSID);
- showLsid.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowLSID = showLsid.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID, isShowLSID);
- }
- });
-
- final Button showNomenclaturalCode = new Button(child, SWT.CHECK);
- boolean isShowNomenclaturalCode = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE);
- showNomenclaturalCode.setText(Messages.DatabasePreferencesPage_show_nomenclatural_code);
- showNomenclaturalCode.setSelection(isShowNomenclaturalCode);
- showNomenclaturalCode.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowNomenclaturalCode = showNomenclaturalCode.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE, isShowNomenclaturalCode);
- }
- });
-
- final Button showNameCache = new Button(child, SWT.CHECK);
- boolean isShowNameCache = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE);
- showNameCache.setText(Messages.DatabasePreferencesPage_show_namecache);
- showNameCache.setSelection(isShowNomenclaturalCode);
- showNameCache.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowNameCache = showNameCache.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE, isShowNameCache);
- }
- });
- final Button showAppendedPhrase = new Button(child, SWT.CHECK);
- boolean isShowAppendedPhrase = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE);
- showAppendedPhrase.setText(Messages.DatabasePreferencesPage_show_appended_phrase);
- showAppendedPhrase.setSelection(isShowAppendedPhrase);
- showAppendedPhrase.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowAppendedPhrase = showAppendedPhrase.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE, isShowAppendedPhrase);
- }
- });
-
- final Button showRank = new Button(child, SWT.CHECK);
- boolean isShowRank = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK);
- showRank.setText(Messages.DatabasePreferencesPage_show_rank);
- showRank.setSelection(isShowRank);
- showRank.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowRank = showRank.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK, isShowRank);
- }
- });
- final Button showEpithets = new Button(child, SWT.CHECK);
- boolean isShowEpithets = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS);
- showEpithets.setText(Messages.DatabasePreferencesPage_show_atomised_epithets);
- showEpithets.setSelection(isShowEpithets);
- showEpithets.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowEpithets = showEpithets.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS, isShowEpithets);
- }
- });
- final Button showAuthorshipCache = new Button(child, SWT.CHECK);
- boolean isShowAuthorshipCache = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE);
- showAuthorshipCache.setText(Messages.DatabasePreferencesPage_show_authorship_cache);
- showAuthorshipCache.setSelection(isShowAuthorshipCache);
- showAuthorshipCache.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowAuthorshipCache = showAuthorshipCache.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE, isShowAuthorshipCache);
- }
- });
-
- final Button showAuthorship = new Button(child, SWT.CHECK);
- boolean isShowAuthorship = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP);
- showAuthorship.setText(Messages.DatabasePreferencesPage_show_author_section);
- showAuthorship.setSelection(isShowAuthorship);
- showAuthorship.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowAuthorship = showAuthorship.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP, isShowAuthorship);
- }
- });
-
- final Button showNomenclaturalRef = new Button(child, SWT.CHECK);
- boolean isShowNomenclaturalRef = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE);
- showNomenclaturalRef.setText(Messages.DatabasePreferencesPage_Show_nomenclatural_Ref);
- showNomenclaturalRef.setSelection(isShowNomenclaturalRef);
- showNomenclaturalRef.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowNomenclaturalRef = showNomenclaturalRef.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE, isShowNomenclaturalRef);
- }
- });
-
- final Button showNomenclaturalStatus = new Button(child, SWT.CHECK);
- boolean isShowNomenclaturalStatus = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS);
- showNomenclaturalStatus.setText(Messages.DatabasePreferencesPage_Show_nomenclaturalStatus);
- showNomenclaturalStatus.setSelection(isShowNomenclaturalStatus);
- showNomenclaturalStatus.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowNomenclaturalStatus = showNomenclaturalStatus.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS, isShowNomenclaturalStatus);
- }
- });
-
- final Button showProtologue = new Button(child, SWT.CHECK);
- boolean isShowProtologue = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE);
- showProtologue.setText(Messages.DatabasePreferencesPage_Show_Protologue);
- showProtologue.setSelection(isShowProtologue);
- showProtologue.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowProtologue = showProtologue.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE, isShowProtologue);
- }
- });
-
- final Button showTypeDesignation = new Button(child, SWT.CHECK);
- boolean isShowTypeDesignation = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION);
- showTypeDesignation.setText(Messages.DatabasePreferencesPage_Show_Type_designation);
- showTypeDesignation.setSelection(isShowTypeDesignation);
- showTypeDesignation.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowTypeDesignation = showTypeDesignation.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION, isShowTypeDesignation);
- }
- });
-
-
- final Button showNameRelationship = new Button(child, SWT.CHECK);
- boolean isShowNameRelationship = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP);
- showNameRelationship.setText(Messages.DatabasePreferencesPage_Show_NameRelations);
- showNameRelationship.setSelection(isShowNameRelationship);
- showNameRelationship.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isShowNameRelationship = showNameRelationship.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP, isShowNameRelationship);
- }
- });
-
- if(isSimpleDetailsViewActivated){
- child.setEnabled(true);
- }else{
- child.setEnabled(false);
- }
-
-
-
- // Label emptyLabel = new Label(getFieldEditorParent(), 0);
-
-
-
}
-
protected IPreferenceStore doGetPreferenceStore() {
return PreferencesUtil.getPreferenceStore();
}
}
-/**
- *
- */
- void createNameDetailsViewConfig() {
- config.setSimpleDetailsViewActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION));
- config.setAppendedPhraseActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE));
- config.setAtomisedEpithetsActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS));
- config.setAuthorshipSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP));
- config.setLSIDActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID));
- config.setNameCacheActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_CACHE));
- config.setNameRelationsSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP));
- config.setNomenclaturalCodeActived(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE));
- config.setNomenclaturalStatusSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS));
- config.setNomenclaturalReferenceSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE));
- config.setProtologueActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE));
- config.setRankActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK));
- config.setSimpleDetailsViewActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION));
- config.setTaxonSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON));
- config.setTypeDesignationSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION));
- }
+
public void createNomenclaturalCodeTab(Composite parent){
- composite = addTab(Messages.DatabasePreferencesPage_Define_Default_NomenclaturalCode);
- nomenclaturalCodeCombo = new Combo(composite, SWT.READ_ONLY);
- List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper
+
+ Combo nomenclaturalCodeCombo;
+ Label nomenclaturalCodeLabel;
+
+ composite = addTab(Messages.DatabasePreferencesPage_Define_Default_NomenclaturalCode);
+ nomenclaturalCodeCombo = new Combo(composite, SWT.DROP_DOWN);
+
+ List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper
.getSupportedCodes();
- for (NomenclaturalCode code: supportedCodes) {
+ for (NomenclaturalCode code: supportedCodes) {
nomenclaturalCodeCombo.add(NomenclaturalCodeHelper
.getDescription(code));
}
+ nomenclaturalCodeCombo.select(0);
getLabelAndValues();
//get the actual nomenclatural code and set it as selection: doGetPreferenceStore().getString(IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY);
nomenclaturalCodeCombo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) {
String name = nomenclaturalCodeCombo.getText();
- String selectedPreferenceKey = null;
+
for (String[] labelAndValue: labelAndValues){
if (labelAndValue[0].equals(name)){
selectedPreferenceKey = labelAndValue[1];
-}
+ }
+ public void createSetPublishFlagTab(Composite parent){
+ composite = addTab(Messages.DatabasePreferencesPage_SetPublishFlag);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 2;
+ composite.setLayout(gridLayout);
+ //radio buttons for set publish as default, set not publish as default and inherit from parent
+
+ }
+
public void createBiocaseProviderTab(Composite parent){
composite = addTab(Messages.DatabasePreferencesPage_Biocase_Provider);
- nomenclaturalCodeCombo = new Combo(composite, SWT.READ_ONLY);
- List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper
- .getSupportedCodes();
- for (NomenclaturalCode code: supportedCodes) {
- nomenclaturalCodeCombo.add(NomenclaturalCodeHelper
- .getDescription(code));
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 2;
+ composite.setLayout(gridLayout);
+ biocaseProviderList = new ListComponent(composite, SWT.SCROLL_LINE);
- }
- getLabelAndValues();
- //get the actual nomenclatural code and set it as selection: doGetPreferenceStore().getString(IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY);
- nomenclaturalCodeCombo.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent evt) {
-
- String name = nomenclaturalCodeCombo.getText();
- String selectedPreferenceKey = null;
- for (String[] labelAndValue: labelAndValues){
- if (labelAndValue[0].equals(name)){
- selectedPreferenceKey = labelAndValue[1];
- }
- }
-
-
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY, selectedPreferenceKey);
-
- }
- });
- nomenclaturalCodeLabel = new Label(composite, SWT.READ_ONLY);
-
-
- final Button useLocalPreference = new Button(composite, SWT.CHECK);
- boolean isUseLocalPreference = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY);
- useLocalPreference.setText(Messages.DatabasePreferencesPage_UseLocalPreferences);
- useLocalPreference.setSelection(isUseLocalPreference);
- useLocalPreference.addSelectionListener(new SelectionAdapter(){
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isUseLocalPreference = useLocalPreference.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY, isUseLocalPreference);
- }
- });
+ }
+ public ListComponent getBiocaseProviderList() {
+ return biocaseProviderList;
+ }
+ public void createNameDetailsViewConfigurationTab(Composite parent, NameDetailsConfigurator config){
+ composite = parent;
+ composite = addTab(Messages.DatabasePreferencesPage_details_view_configuration);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ composite.setLayout(gridLayout);
+ nameDetailsConfig = new NameDetailsViewComposite(composite, SWT.SCROLL_LINE, config);
- }
+
+ }
public void createSpecimenOrObservationTab(Composite parent){
- composite = addTab(Messages.DatabasePreferencesPage_Specimen_Or_Observation);
+ composite = addTab(Messages.DatabasePreferencesPage_Specimen_Or_Observation);
final Button showCollectingAreaInGeneralSectionButton = new Button(composite, SWT.CHECK);
- boolean isShowCollectingAreaInGeneralSection = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION);
+ CdmPreference isShowCollectingAreaInGeneralSection = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.ShowCollectingAreasInGeneralSection);
+ if (isShowCollectingAreaInGeneralSection == null){
+ isShowCollectingAreaInGeneralSection = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowCollectingAreasInGeneralSection, Boolean.toString(false));
+ }
showCollectingAreaInGeneralSectionButton.setText(Messages.DatabasePreferncesPage_Show_Collecting_Areas_in_general_section);
- showCollectingAreaInGeneralSectionButton.setSelection(isShowCollectingAreaInGeneralSection);
+
+ showCollectingAreaInGeneralSectionButton.setSelection(Boolean.valueOf(isShowCollectingAreaInGeneralSection.getValue()));
showCollectingAreaInGeneralSectionButton.addSelectionListener(new SelectionAdapter(){
@Override
public void widgetSelected(SelectionEvent e) {
});
final Button determinationOnlyForFieldUnitsButton = new Button(composite, SWT.CHECK);
- boolean isDeterminationOnlyForFieldUnits = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS);
+// boolean isDeterminationOnlyForFieldUnits = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS);
+ CdmPreference isDeterminationOnlyForFieldUnits = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.DeterminationOnlyForFieldUnits);
+ if (isDeterminationOnlyForFieldUnits == null){
+ isDeterminationOnlyForFieldUnits = CdmPreference.NewDatabaseInstance(PreferencePredicate.DeterminationOnlyForFieldUnits, Boolean.toString(false));
+ }
determinationOnlyForFieldUnitsButton.setText(Messages.DatabasePreferncesPage_Determination_only_for_field_unnits);
- determinationOnlyForFieldUnitsButton.setSelection(isDeterminationOnlyForFieldUnits);
+
+ determinationOnlyForFieldUnitsButton.setSelection(Boolean.valueOf(isDeterminationOnlyForFieldUnits.getValue()));
determinationOnlyForFieldUnitsButton.addSelectionListener(new SelectionAdapter(){
@Override
public void widgetSelected(SelectionEvent e) {
});
final Button showTaxonAssociationButton = new Button(composite, SWT.CHECK);
- boolean isShowTaxonAssociation = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS);
+ CdmPreference isShowTaxonAssociation = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.ShowTaxonAssociations);
+ if (isShowTaxonAssociation == null){
+ isShowTaxonAssociation = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowTaxonAssociations, Boolean.toString(false));
+ }
showTaxonAssociationButton.setText(Messages.DatabasePreferncesPage_Taxon_Associations);
- showTaxonAssociationButton.setSelection(isShowTaxonAssociation);
+
+ showTaxonAssociationButton.setSelection(Boolean.valueOf(isShowTaxonAssociation.getValue()));
showTaxonAssociationButton.addSelectionListener(new SelectionAdapter(){
@Override
public void widgetSelected(SelectionEvent e) {
}
});
+ final Button showLifeFormButton = new Button(composite, SWT.CHECK);
+ CdmPreference isShowLifeForm = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.ShowLifeForm);
+ if (isShowLifeForm == null){
+ isShowLifeForm = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowLifeForm, Boolean.toString(false));
+ }
+
+ showLifeFormButton.setText(Messages.DatabasePreferncesPage_Life_Form);
+ showLifeFormButton.setSelection(Boolean.valueOf(isShowLifeForm.getValue()));
+ showLifeFormButton.addSelectionListener(new SelectionAdapter(){
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ boolean isShowLifeForm = showLifeFormButton.getSelection();
+ PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_LIFE_FORM, isShowLifeForm);
+ }
+ });
+
+// Composite useLocalComp = new Composite(composite, SWT.NONE);
+
+
+ final Button useLocalPreference = new Button(composite, SWT.CHECK);
+ boolean isUseLocalPreference = isShowTaxonAssociation.isAllowOverride();
+ useLocalPreference.setText(Messages.DatabasePreferencesPage_UseLocalPreferences);
+ GridData gridData = new GridData(SWT.FILL, SWT.BOTTOM, false, false);
+ gridData.verticalIndent = 10;
+ useLocalPreference.setLayoutData(gridData);
+
+ useLocalPreference.setSelection(isUseLocalPreference);
+ useLocalPreference.addSelectionListener(new SelectionAdapter(){
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ boolean isUseLocalPreference = useLocalPreference.getSelection();
+ PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.ALLOW_OVERRIDE_SPECIMEN_PREF, isUseLocalPreference);
+ }
+ });
+
}
*/
@Override
public void createControl(Composite parent) {
- createNameDetailsConfiguration(parent);
+ createNameDetailsViewConfigurationTab(parent, config);
createNomenclaturalCodeTab(parent);
createSpecimenOrObservationTab(parent);
+ createBiocaseProviderTab(parent);
setControl(parent);
}
* @return
*/
public NameDetailsConfigurator getConfig() {
-
return config;
}
+/**
+ *
+ */
+public Abcd206ImportConfigurator getAbcdImportConfig() {
+ return abcdImportConfigurator;
+
+}
+
+/**
+ * @return
+ */
+public void createAbcdImportConfig() {
+ this.abcdImportConfigurator.setAddIndividualsAssociationsSuchAsSpecimenAndObservations(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ADD_INDIVIDUALS_ASSOCIATIONS_SUCH_AS_SPECIMEN_AND_OBSERVATIONS));
+ this.abcdImportConfigurator.setAddMediaAsMediaSpecimen(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ADD_MEDIA_AS_MEDIASPECIMEN));
+ this.abcdImportConfigurator.setAllowReuseOtherClassifications(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ALLOW_REUSE_OTHER_CLASSIFICATIONS));
+ //this.abcdImportConfigurator.setClassificationUuid(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_CLASSIFICATION_UUID));
+ this.abcdImportConfigurator.setDeduplicateClassifications(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEDUPLICATE_CLASSIFICATIONS));
+ this.abcdImportConfigurator.setDeduplicateReferences(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEDUPLICATE_REFERENCES));
+ // this.abcdImportConfigurator.setDefaultAuthor(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEFAULT_AUTHOR));
+ this.abcdImportConfigurator.setGetSiblings(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DO_SIBLINGS));
+ this.abcdImportConfigurator.setIgnoreAuthorship(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_IGNORE_AUTHORSHIP));
+ this.abcdImportConfigurator.setIgnoreImportOfExistingSpecimen(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_IGNORE_IMPORT_OF_EXISTING_SPECIMEN));
+ this.abcdImportConfigurator.setMapUnitIdToAccessionNumber(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TO_ACCESSION_NUMBER));
+ this.abcdImportConfigurator.setMapUnitIdToBarcode(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TO_BARCODE));
+ this.abcdImportConfigurator.setMapUnitIdToCatalogNumber(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TOCATALOG_NUMBER));
+ this.abcdImportConfigurator.setMoveNewTaxaToDefaultClassification(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MOVE_NEW_TAXA_TO_DEFAULT_CLASSIFICATION));
+ this.abcdImportConfigurator.setReuseExistingDescriptiveGroups(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_DESCRIPTIVE_GROUPS));
+ this.abcdImportConfigurator.setReuseExistingTaxaWhenPossible(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_TAXA_WHEN_POSSIBLE));
+
+}
+