Project

General

Profile

« Previous | Next » 

Revision c1662123

Added by Katja Luther over 4 years ago

ref #8385: adapt preference keys to preference predicates

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ExternalServicesPreferences.java
17 17
import org.eclipse.swt.widgets.Control;
18 18
import org.eclipse.swt.widgets.Label;
19 19

  
20
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
20 21
import eu.etaxonomy.taxeditor.l10n.Messages;
21 22
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
22 23

  
......
58 59
       mobotComp.setLayoutData(data);
59 60

  
60 61

  
61
       openUrl = new StringFieldEditor(PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_ACCESS_POINT),
62
       openUrl = new StringFieldEditor(PreferencesUtil.createPreferenceString(PreferencePredicate.MobotOpenUrlServiceAccessPoint.getKey()),
62 63
               "Access Point", mobotComp); //$NON-NLS-1$
63 64
       openUrl.setPreferenceStore(getPreferenceStore());
64 65
       openUrl.load();
......
68 69

  
69 70
       reference.setLayoutData(gridDataLabel);
70 71
       maxWidth = new IntegerFieldEditor(
71
               PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH),
72
               PreferencesUtil.createPreferenceString(PreferencePredicate.MobotOpenUrlServiceMaxWidth.getKey()),
72 73
               Messages.ExternalServicesPreferences_max_width,
73 74
               mobotComp);
74 75
       maxWidth.setPreferenceStore(getPreferenceStore());
75 76
       maxWidth.load();
76 77

  
77 78
       maxHeight = new IntegerFieldEditor(
78
               PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT),
79
               PreferencesUtil.createPreferenceString(PreferencePredicate.MobotOpenUrlServiceMaxHeight.getKey()),
79 80
               Messages.ExternalServicesPreferences_max_height,
80 81
               mobotComp);
81 82
       maxHeight.setPreferenceStore(getPreferenceStore());
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
46 46
	/**
47 47
	 * Whether to show database id in the entity selection dialogs.
48 48
	 */
49
	public static final String SHOW_ID_IN_ENTITY_SELECTION_DIAOLOG = "eu.etaxonomy.taxeditor.showIdInEntitySelectionDiaolog";
49
	//public static final String SHOW_ID_IN_ENTITY_SELECTION_DIAOLOG = "eu.etaxonomy.taxeditor.showIdInEntitySelectionDiaolog";
50 50

  
51 51
	/**
52 52
	 * Whether to show vocabulary of the term when displaying it's label.
......
109 109

  
110 110
	public static final String SHOW_EXPERIMENTAL_FEATURES = "eu.etaxonomy.taxeditor.showExperimentalFeatures";
111 111

  
112
	public static final String OPENURL_ACCESS_POINT = "eu.etaxonomy.taxeditor.openUrlAccessPoint";
112
	//public static final String OPENURL_ACCESS_POINT = "eu.etaxonomy.taxeditor.openUrlAccessPoint";
113 113

  
114
	public static final String OPENURL_IMAGE_MAX_WIDTH = "eu.etaxonomy.taxeditor.openUrlImageMaxWidth";
114
	//public static final String OPENURL_IMAGE_MAX_WIDTH = "eu.etaxonomy.taxeditor.openUrlImageMaxWidth";
115 115

  
116
	public static final String OPENURL_IMAGE_MAX_HEIGHT = "eu.etaxonomy.taxeditor.openUrlImageMaxHeight";
116
	//public static final String OPENURL_IMAGE_MAX_HEIGHT = "eu.etaxonomy.taxeditor.openUrlImageMaxHeight";
117 117

  
118 118
	/**
119 119
	 * Whether the occurrence bulk editor should show {@link FieldUnit} objects
......
122 122
	public static final String SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS = "eu.etaxonomy.taxeditor.navigation.search.openResultInSeparateWindows";
123 123
	public static final String DISABLE_SERVICES_API_TIMESTAMP_CHECK = "eu.etaxonomy.taxeditor.cdmlib.remoting.disableServicesApiTimestampCheck";
124 124
	public static final String ADD_TYPES_TO_ALL_NAMES = "eu.etaxonomy.taxeditor.store.addTypeToAllNames";
125
    public static final String DETERMINATION_ONLY_FOR_FIELD_UNITS = "eu.etaxonomy.taxeditor.specimen.determinationOnlyOnFieldUnitLevel";
126
    public static final String SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION = "eu.etaxonomy.taxeditor.specimen.showCollectingAreasInGeneralSection";
127
    public static final String SHOW_TAXON_ASSOCIATIONS = "eu.etaxonomy.taxeditor.specimen.showTaxonAssociations";
128
    public static final String SHOW_LIFE_FORM = "eu.etaxonomy.taxeditor.specimen.showLifeForm";
129
    public static final String COMMON_NAME_AREA_VOCABULARIES = "eu.etaxonomy.taxeditor.commonNames.areaVocabularies";
125
   // public static final String DETERMINATION_ONLY_FOR_FIELD_UNITS = "eu.etaxonomy.taxeditor.specimen.determinationOnlyOnFieldUnitLevel";
126
   // public static final String SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION = "eu.etaxonomy.taxeditor.specimen.showCollectingAreasInGeneralSection";
127
   // public static final String SHOW_TAXON_ASSOCIATIONS = "eu.etaxonomy.taxeditor.specimen.showTaxonAssociations";
128
    //public static final String SHOW_LIFE_FORM = "eu.etaxonomy.taxeditor.specimen.showLifeForm";
129
   // public static final String COMMON_NAME_AREA_VOCABULARIES = "eu.etaxonomy.taxeditor.commonNames.areaVocabularies";
130 130

  
131 131
//Taxon Details View
132 132
//    public static final String SHOW_SEC_DETAILS = "eu.etaxonomy.taxeditor.taxon.showSecDetails";
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/MobotOpenUrlPreferences.java
12 12
import org.eclipse.jface.preference.IntegerFieldEditor;
13 13
import org.eclipse.jface.preference.StringFieldEditor;
14 14

  
15
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
15 16
import eu.etaxonomy.taxeditor.preference.menu.FieldEditorPreferencePageE4;
16 17

  
17 18
/**
......
25 26
    @Override
26 27
    protected void createFieldEditors() {
27 28
        addField(new StringFieldEditor(
28
                PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_ACCESS_POINT),
29
                PreferencesUtil.createPreferenceString(PreferencePredicate.MobotOpenUrlServiceAccessPoint.getKey()),
29 30
                "Mobot Open Url Service Access Point:", getFieldEditorParent()));
30 31
        addField(new IntegerFieldEditor(
31
                PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH),
32
                PreferencesUtil.createPreferenceString(PreferencePredicate.MobotOpenUrlServiceMaxWidth.getKey()),
32 33
                "Image Maximum Width:",
33 34
                getFieldEditorParent()));
34 35
        addField(new IntegerFieldEditor(
35
                PreferencesUtil.createPreferenceString(IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT),
36
                PreferencesUtil.createPreferenceString(PreferencePredicate.MobotOpenUrlServiceMaxHeight.getKey()),
36 37
                "Image Maximum Height:",
37 38
                getFieldEditorParent()));
38 39

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
869 869
                "http://edit.africamuseum.be/edit_wp5/v1.2/rest_gen.php");
870 870
        //FIXME : changed default for SHOULD_CONNECT_AT_STARTUP to false (ticket 3828) until resolution
871 871
        getPreferenceStore().setDefault(createPreferenceString(SHOULD_CONNECT_AT_STARTUP), false);
872
        getPreferenceStore().setDefault(createPreferenceString(OPENURL_ACCESS_POINT),
872
        getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.MobotOpenUrlServiceAccessPoint.getKey()),
873 873
                "http://www.biodiversitylibrary.org/openurl");
874
        getPreferenceStore().setDefault(createPreferenceString(OPENURL_IMAGE_MAX_WIDTH), "1000");
875
        getPreferenceStore().setDefault(createPreferenceString(OPENURL_IMAGE_MAX_HEIGHT), "1000");
874
        getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.MobotOpenUrlServiceMaxWidth.getKey()), "1000");
875
        getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.MobotOpenUrlServiceMaxHeight.getKey()), "1000");
876 876
        getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_TAXA, true);
877 877
        getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_SYNONYMS, true);
878 878
        getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_NAMES, true);
......
904 904
        getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.AvailableDistributionAreaTerms.getKey())), true);
905 905
        getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey())), true);
906 906
        getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.CommonNameAreaVocabularies.getKey())), false);
907
        getPreferenceStore().setDefault(createPreferenceString(FILTER_COMMON_NAME_REFERENCES), false);
907
        getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.CommonNameReferencesWithMarker.getKey()), false);
908 908
        getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.ShowTaxonNodeWizard.getKey()), Boolean.valueOf(PreferencePredicate.ShowTaxonNodeWizard.getDefaultValue().toString()));
909 909
        getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.ShowNamespaceInSource.getKey()), Boolean.valueOf(PreferencePredicate.ShowNamespaceInSource.getDefaultValue().toString()));
910 910
        getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.ShowIdInSource.getKey()), Boolean.valueOf(PreferencePredicate.ShowIdInSource.getDefaultValue().toString()));
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java
48 48
import eu.etaxonomy.cdm.model.common.CdmBase;
49 49
import eu.etaxonomy.cdm.model.common.ICdmBase;
50 50
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
51
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
51 52
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
52 53
import eu.etaxonomy.taxeditor.l10n.Messages;
53 54
import eu.etaxonomy.taxeditor.model.MessagingUtils;
54 55
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
55
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
56 56
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
57 57
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
58 58

  
......
414 414
			}
415 415
			UuidAndTitleCache uuidAndTitleCache = (UuidAndTitleCache) element;
416 416
			String titleCache = uuidAndTitleCache.getTitleCache();
417
			if(PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_ID_IN_ENTITY_SELECTION_DIAOLOG)){
417
			if(PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSelectionDialog.getKey())){
418 418
			    titleCache += " ["+uuidAndTitleCache.getId()+"]";
419 419
			}
420 420
			if (element instanceof EntityDTOBase){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredIdentifierSelectionDialog.java
5 5

  
6 6
import eu.etaxonomy.cdm.api.service.IIdentifiableEntityService;
7 7
import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
8
import eu.etaxonomy.cdm.model.term.DefinedTerm;
9 8
import eu.etaxonomy.cdm.model.common.ICdmBase;
9
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
10
import eu.etaxonomy.cdm.model.term.DefinedTerm;
10 11
import eu.etaxonomy.cdm.persistence.query.MatchMode;
11
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
12 12
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
13 13
import eu.etaxonomy.taxeditor.store.CdmStore;
14 14

  
......
40 40
				}
41 41
				IdentifiedEntityDTO identifiedEntity = (IdentifiedEntityDTO) element;
42 42
				String titleCache = identifiedEntity.getCdmEntity().getTitleCache();
43
				if(PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_ID_IN_ENTITY_SELECTION_DIAOLOG)){
43
				if(PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSelectionDialog.getKey())){
44 44
				    titleCache += " ["+identifiedEntity.getCdmEntity().getUuid()+"]";
45 45
				}
46 46
				// add identifier
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalAuthorSelectionDialog.java
22 22
import eu.etaxonomy.cdm.model.agent.Person;
23 23
import eu.etaxonomy.cdm.model.agent.Team;
24 24
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
25
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
25 26
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
26 27
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
27 28
import eu.etaxonomy.taxeditor.newWizard.NewPersonWizard;
28 29
import eu.etaxonomy.taxeditor.newWizard.NewTeamWizard;
29
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
30 30
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
31 31
import eu.etaxonomy.taxeditor.store.CdmStore;
32 32

  
......
131 131
			    if (!titleCache.equals(abbrevTitleCache)){
132 132
			        abbrevTitleCache += " - " + titleCache;
133 133
			    }
134
			    if(PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_ID_IN_ENTITY_SELECTION_DIAOLOG)){
134
			    if(PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSelectionDialog.getKey())){
135 135
			        abbrevTitleCache += " ["+uuidAndTitleCache.getId()+"]";
136 136
			    }
137 137
			}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalReferenceSelectionDialog.java
21 21
import eu.etaxonomy.cdm.api.service.dto.EntityDTOBase.CdmEntity;
22 22
import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
23 23
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
24
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
24 25
import eu.etaxonomy.cdm.model.reference.Reference;
25 26
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
26 27
import eu.etaxonomy.cdm.persistence.query.MatchMode;
......
192 193
			if (!abbrevTitleCache.equals(titleCache)){
193 194
				abbrevTitleCache += " - " + titleCache;
194 195
			}
195
			if(PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_ID_IN_ENTITY_SELECTION_DIAOLOG)){
196
			if(PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSelectionDialog.getKey())){
196 197
				abbrevTitleCache += " ["+uuidAndTitleCache.getId()+"]";
197 198
			}
198 199
            return abbrevTitleCache;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ReferenceSelectionDialog.java
31 31
import eu.etaxonomy.cdm.api.service.IReferenceService;
32 32
import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
33 33
import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO.AlternativeIdentifier;
34
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
34 35
import eu.etaxonomy.cdm.model.reference.Reference;
35 36
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
36 37
import eu.etaxonomy.cdm.persistence.query.MatchMode;
......
215 216
    protected void addIdentifierCheckButton(Composite searchAndFilter) {
216 217
        Button btnCheckButton = new Button(searchAndFilter, SWT.CHECK);
217 218
        btnCheckButton.setText("Use Identifier");
218
        if (PreferencesUtil.getBooleanValue(IPreferenceKeys.IS_SEARCH_FOR_IDENTIFIER_AS_DEFAULT)){
219
        if (PreferencesUtil.getBooleanValue(PreferencePredicate.SearchForIdentifierAsDefault.getKey())){
219 220
            btnCheckButton.setSelection(true);
220 221
            useIdentifier = true;
221 222
        }
......
277 278
            }
278 279
            UuidAndTitleCache uuidAndTitleCache = (UuidAndTitleCache) element;
279 280
            String titleCache = uuidAndTitleCache.getTitleCache();
280
            if(PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_ID_IN_ENTITY_SELECTION_DIAOLOG)){
281
            if(PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSelectionDialog.getKey())){
281 282
                titleCache += " ["+uuidAndTitleCache.getId()+"]";
282 283
            }
283 284
            if (isUseIdentifier()){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/openurl/OpenUrlSelectorWizard.java
19 19
import eu.etaxonomy.cdm.ext.openurl.MobotOpenUrlServiceWrapper;
20 20
import eu.etaxonomy.cdm.ext.openurl.MobotOpenUrlServiceWrapper.ReferenceType;
21 21
import eu.etaxonomy.cdm.ext.openurl.OpenUrlReference;
22
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
22 23
import eu.etaxonomy.cdm.model.reference.Reference;
23
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
24 24
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
25 25
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
26 26

  
......
65 65
		formFactory = new CdmFormFactory(Display.getDefault());
66 66

  
67 67
		openUrlServiceWrapper = new MobotOpenUrlServiceWrapper();
68
		openUrlServiceWrapper.setBaseUrl(PreferencesUtil.getStringValue(IPreferenceKeys.OPENURL_ACCESS_POINT));
68
		openUrlServiceWrapper.setBaseUrl(PreferencesUtil.getStringValue(PreferencePredicate.MobotOpenUrlServiceAccessPoint.getKey()));
69 69

  
70 70
		query  = new MobotOpenUrlQuery();
71 71

  
......
114 114
	 */
115 115
	public void setOpenUrlReference(OpenUrlReference openUrlReference) {
116 116
		this.openUrlReference = openUrlReference;
117
		this.openUrlReferenceImageUri = openUrlReference.getJpegImage(PreferencesUtil.getIntValue(IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH, true)
118
				, PreferencesUtil.getIntValue(IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT, true));
117
		this.openUrlReferenceImageUri = openUrlReference.getJpegImage(PreferencesUtil.getIntValue(PreferencePredicate.MobotOpenUrlServiceMaxWidth.getKey(), true)
118
				, PreferencesUtil.getIntValue(PreferencePredicate.MobotOpenUrlServiceMaxHeight.getKey(), true));
119 119
	}
120 120

  
121 121
	/**

Also available in: Unified diff