Project

General

Profile

« Previous | Next » 

Revision e98bd118

Added by Katja Luther over 5 years ago

ref #6722: add preference for show life form in field unit details view

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/AbstractPreferenceWizard.java
10 10

  
11 11
import org.eclipse.jface.wizard.WizardPage;
12 12
import org.eclipse.swt.SWT;
13
import org.eclipse.swt.custom.ScrolledComposite;
13 14
import org.eclipse.swt.layout.GridData;
14 15
import org.eclipse.swt.layout.GridLayout;
15 16
import org.eclipse.swt.widgets.Composite;
......
39 40
         if (tabFolder == null){
40 41
             // initialize tab folder
41 42
             if (composite == null) {
42
                 composite = new Composite(getShell(), SWT.NONE);
43
  //          	 composite = new ScrolledComposite(getShell(), SWT.BORDER | SWT.V_SCROLL);
44

  
45
//            	 Composite tabArea = new Composite(scroller, SWT.NONE); 
46
            	 composite = new Composite(getShell(), SWT.NONE);
43 47
             }
44 48
             tabFolder = new TabFolder(composite, SWT.NULL);
45 49
             tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesPage.java
14 14
import org.eclipse.jface.wizard.IWizard;
15 15
import org.eclipse.jface.wizard.IWizardPage;
16 16
import org.eclipse.swt.SWT;
17
import org.eclipse.swt.custom.ScrolledComposite;
17 18
import org.eclipse.swt.events.SelectionAdapter;
18 19
import org.eclipse.swt.events.SelectionEvent;
19 20
import org.eclipse.swt.layout.GridLayout;
......
215 216
                 PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS, isShowTaxonAssociation);
216 217
              }
217 218
         });
219
        
220
        final Button showLifeFormButton = new Button(composite, SWT.CHECK);
221
        boolean isShowLifeForm = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_LIFE_FORM);
222
        showLifeFormButton.setText(Messages.DatabasePreferncesPage_Life_Form);
223
        showLifeFormButton.setSelection(isShowLifeForm);
224
        showLifeFormButton.addSelectionListener(new SelectionAdapter(){
225
             @Override
226
             public void widgetSelected(SelectionEvent e) {
227
                 boolean isShowLifeForm = showLifeFormButton.getSelection();
228
                 PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_LIFE_FORM, isShowLifeForm);
229
              }
230
         });
218 231

  
219 232

  
220 233

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairWizard.java
50 50
                config = SortIndexUpdaterConfigurator.NewInstance(null);
51 51
                config.setDoFeatureNode(false);
52 52
                config.setDoPolytomousKeyNode(false);
53
                
53 54

  
54 55
             }
55 56
            if (config.isDoFeatureNode() || config.isDoPolytomousKeyNode() || config.isDoTaxonNode()){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java
193 193
    public static String DatabasePreferncesPage_Determination_only_for_field_unnits;
194 194
    public static String DatabasePreferncesPage_Show_Collecting_Areas_in_general_section;
195 195
    public static String DatabasePreferncesPage_Taxon_Associations;
196
    public static String DatabasePreferncesPage_Life_Form;
196 197

  
197 198
    public static String DatabasePreferencesPage_Biocase_Provider;
198 199
    public static String DatabasePreferencesPage_details_view_configuration;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
189 189
DatabasePreferencesPage_Define_Default_NomenclaturalCode=Define default nomenclatural code
190 190
DatabasePreferencesPage_UseLocalPreferences=Allow to use local preference
191 191
DatabasePreferencesPage_Specimen_Or_Observation=Specimen or observation configuration
192
DatabasePreferncesPage_Life_Form=Show Life-Form in details view of field units
192 193

  
193 194
ImportFromFileAndChooseVocIdWizardPage_AreaVoc=Area Vocabulary
194 195
ImportFromFileAndChooseVocIdWizardOage_AreaVoc_toolTip=Please choose a vocabulary for the used areas.
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
168 168
DatabasePreferncesPage_Determination_only_for_field_unnits=Determinations nur f?r Field Units
169 169
DatabasePreferncesPage_Show_Collecting_Areas_in_general_section=Zeige Sammelgebiete im allgemeinen Teil
170 170
DatabasePreferncesPage_Taxon_Associations=Zeige Taxon Assoziationen eines Specimen im Details View
171
DatabasePreferncesPage_Life_Form=Zeige Life-Form im Details-View von Field Units an
171 172

  
172 173
DatabasePreferencesPage_Biocase_Provider=Biocase Provider Auswahl
173 174
DatabasePreferencesPage_details_view_configuration=Details view Konfiguration
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java
84 84
                PreferencesUtil.setShowIdInVocabularyInChecklistEditor(isShowIdInVocabulary);
85 85
             }
86 86
        });
87
        
88
        final Button showSymbol = new Button(child, SWT.CHECK);
89
        boolean isShowSymbol = PreferencesUtil.isShowSymbolInChecklistEditor();
90
        showSymbol.setText("Show Symbol of the areas");
91
        showSymbol.setSelection(isShowSymbol);
92
        showSymbol.addSelectionListener(new SelectionAdapter(){
93
            @Override
94
            public void widgetSelected(SelectionEvent e) {
95
                boolean isShowSymbol = showSymbol.getSelection();
96
                PreferencesUtil.setShowSymbolInChecklistEditor(isShowSymbol);
97
             }
98
        });
87 99
        PreferencesUtil.recursiveSetEnabled(button_openFeatureTree, CdmStore.isActive());
88 100
        boolean isShowRank = PreferencesUtil.isShowRankInChecklistEditor();
89 101
        final Button activateRankButton = new Button(child, SWT.CHECK);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
134 134

  
135 135
    public static final String SHOW_TAXON_ASSOCIATIONS = "eu.etaxonomy.taxeditor.specimen.showTaxonAssociations";
136 136

  
137
    public static final String SHOW_LIFE_FORM = "eu.etaxonomy.taxeditor.specimen.showLifeForm";
138
    
137 139
    public static final String DISTRIBUTION_AREA_PREFRENCES_ACTIVE = "eu.etaxonomy.taxeditor.checklist.distributionAreaPreferencesActive";
138 140

  
139 141
    public static final String DISTRIBUTION_AREA_OCCURENCE_STATUS = "eu.etaxonomy.taxeditor.checklist.distributionAreaStatus";
......
141 143
    public static final String DISTRIBUTION_AREA_OCCURENCE_STATUS_GRAYED = "eu.etaxonomy.taxeditor.checklist.distributionAreaStatusGrayed";
142 144

  
143 145
    public static final String CHECKLIST_ID_IN_VOCABULARY = "eu.etaxonomy.taxeditor.checklist.checklistIdInVocabulary";
146
    public static final String CHECKLIST_SYMBOL = "eu.etaxonomy.taxeditor.checklist.checklistSymbol";
144 147
    public static final String CHECKLIST_SHOW_RANK = "eu.etaxonomy.taxeditor.checklist.checklistShowRank";
145 148

  
146 149
    public static final String SHOW_ADVANCED_MEDIA_SECTION = "eu.etaxonomy.taxeditor.media.showAdvancedMedia";
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
479 479
		getPreferenceStore().setDefault(OPENURL_IMAGE_MAX_HEIGHT, "1000");
480 480
		getPreferenceStore().setDefault(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE, false);
481 481
		getPreferenceStore().setDefault(CHECKLIST_ID_IN_VOCABULARY, true);
482
		getPreferenceStore().setDefault(CHECKLIST_SYMBOL, false);
482 483
		getPreferenceStore().setDefault(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS, true);
483 484
		getPreferenceStore().setDefault(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE, true);
484 485
		getPreferenceStore().setDefault(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP, true);
......
951 952
    public static void setShowIdInVocabularyInChecklistEditor(boolean selection) {
952 953
        getPreferenceStore().setValue(CHECKLIST_ID_IN_VOCABULARY, selection);
953 954
    }
955
    
956
    /**
957
     * @return
958
     */
959
    public static boolean isShowSymbolInChecklistEditor() {
960
       return getPreferenceStore().getBoolean(IPreferenceKeys.CHECKLIST_SYMBOL);
961
    }
962
    public static void setShowSymbolInChecklistEditor(boolean selection) {
963
        getPreferenceStore().setValue(CHECKLIST_SYMBOL, selection);
964
    }
954 965

  
955 966
    /**
956 967
     * @return
......
996 1007

  
997 1008

  
998 1009
        getPreferenceStore().setValue(SHOW_SIMPLE_NAME_DETAILS_TAXON,
999
                (sectionMap.get("taxon")));
1000
        config.setTaxonSectionActivated(sectionMap.get("taxon"));
1010
                (getValue(sectionMap, "taxon")));
1011
        config.setTaxonSectionActivated(getValue(sectionMap, "taxon"));
1001 1012

  
1002 1013
        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_LSID,
1003
                (sectionMap.get("lsid")));
1004
        config.setLSIDActivated(sectionMap.get("lsid"));
1014
                (getValue(sectionMap, "lsid")));
1015
        config.setLSIDActivated(getValue(sectionMap, "lsid"));
1005 1016

  
1006 1017
        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE,
1007
                (sectionMap.get("nc")));
1008
        config.setNomenclaturalCodeActived(sectionMap.get("nc"));
1018
                (getValue(sectionMap, "nc")));
1019
        config.setNomenclaturalCodeActived(getValue(sectionMap, "nc"));
1009 1020

  
1010 1021
        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE,
1011
                (sectionMap.get("ap")));
1012
        config.setAppendedPhraseActivated(sectionMap.get("ap"));
1022
                (getValue(sectionMap, "ap")));
1023
        config.setAppendedPhraseActivated(getValue(sectionMap, "ap"));
1013 1024

  
1014 1025
        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_RANK,
1015
                (sectionMap.get("rank")));
1016
        config.setRankActivated(sectionMap.get("rank"));
1026
                (getValue(sectionMap, "rank")));
1027
        config.setRankActivated(getValue(sectionMap, "rank"));
1017 1028

  
1018 1029

  
1019 1030
        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS,
1020
                (sectionMap.get("atomisedEpithets")));
1021
        config.setAtomisedEpithetsActivated(sectionMap.get("atomisedEpithets"));
1031
                (getValue(sectionMap, "atomisedEpithets")));
1032
        config.setAtomisedEpithetsActivated(getValue(sectionMap, "atomisedEpithets"));
1022 1033

  
1023 1034
        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP,
1024
                (sectionMap.get("author")));
1025
        config.setAuthorshipSectionActivated(sectionMap.get("author"));
1035
                (getValue(sectionMap,"author")));
1036
        config.setAuthorshipSectionActivated(getValue(sectionMap,"author"));
1026 1037

  
1027 1038
        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE,
1028
                (sectionMap.get("nomRef")));
1039
                (getValue(sectionMap, "nomRef")));
1029 1040
        config.setNomenclaturalReferenceSectionActivated(sectionMap.get("nomRef"));
1030 1041

  
1031 1042
        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS,
1032
                (sectionMap.get("nomStat")));
1033
        config.setNomenclaturalStatusSectionActivated(sectionMap.get("nomStat"));
1043
                (getValue(sectionMap, "nomStat")));
1044
        config.setNomenclaturalStatusSectionActivated(getValue(sectionMap, "nomStat"));
1034 1045

  
1035 1046

  
1036 1047
        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_PROTOLOGUE,
1037
                (sectionMap.get("protologue")));
1038
        config.setProtologueActivated(sectionMap.get("protologue"));
1048
                (getValue(sectionMap,"protologue")));
1049
        config.setProtologueActivated(getValue(sectionMap,"protologue"));
1039 1050

  
1040 1051
        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION,
1041
                (sectionMap.get("typeDes")));
1042
        config.setTypeDesignationSectionActivated(sectionMap.get("typeDes"));
1052
                (getValue(sectionMap,"typeDes")));
1053
        config.setTypeDesignationSectionActivated(getValue(sectionMap,"typeDes"));
1043 1054

  
1044 1055
        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP,
1045
                (sectionMap.get("nameRelation")));
1046
        config.setNameRelationsSectionActivated(sectionMap.get("nameRelation"));
1056
                (getValue(sectionMap,"nameRelation")));
1057
        config.setNameRelationsSectionActivated(getValue(sectionMap,"nameRelation"));
1058
        
1059
        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_HYBRID,
1060
                (getValue(sectionMap, "hybrid")));
1061
        config.setHybridActivated(getValue(sectionMap,"hybrid"));
1047 1062

  
1048 1063
        return config;
1049 1064
    }
1050 1065

  
1051
    public static boolean getIsDeterminiationOnlyForFieldUnit(boolean local){
1066
    private static Boolean getValue(Map<String, Boolean> sectionMap, String string) {
1067
		if (sectionMap.containsKey(string)){
1068
			return sectionMap.get(string);
1069
		}else{
1070
			return true;
1071
		}
1072
		
1073
	}
1074

  
1075
	public static boolean getIsDeterminiationOnlyForFieldUnit(boolean local){
1052 1076
        CdmPreference preference = null;
1053 1077

  
1054 1078
        if (!local) {

Also available in: Unified diff