Project

General

Profile

« Previous | Next » 

Revision a9faed7f

Added by Katja Luther over 5 years ago

ref #7440: filter common name references only when preference is set

View differences:

eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/LifeCycleManager.java
34 34
import org.osgi.service.event.Event;
35 35

  
36 36
import eu.etaxonomy.taxeditor.model.IContextListener;
37
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
37 38
import eu.etaxonomy.taxeditor.store.CdmStore;
38 39

  
39 40
/**
......
63 64
    private void processAdditions(MApplication application) {
64 65
        this.application = application;
65 66
        hideParts();
67

  
66 68
    }
67 69

  
68 70
    @ProcessRemovals
......
124 126
     */
125 127
    @Override
126 128
    public void contextStart(IMemento memento, IProgressMonitor monitor) {
129
        PreferencesUtil.updateDBPreferences();
127 130
        hideParts();
128 131
    }
129 132

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
235 235
    public static final String INHERIT_FROM_PARENT = "PARENT";
236 236
    public static final String PUBLISH = "PUBLISH";
237 237

  
238
    public static final String FILTER_COMMON_NAME_REFERENCES = "eu.etaxonomy.taxeditor.references.selection.filterCommonNameReferences";
239

  
238 240

  
239 241

  
240 242

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
600 600
		getPreferenceStore().setDefault(OVERRIDE_SPECIMEN_PREF, false);
601 601
		getPreferenceStore().setDefault(OVERRIDE_NAME_DETAILS, false);
602 602
		getPreferenceStore().setDefault(DISTRIBUTION_AREA_PREFRENCES_ACTIVE_OVERRIDE, false);
603
		getPreferenceStore().setDefault(FILTER_COMMON_NAME_REFERENCES, false);
603 604

  
604 605

  
605 606
	}
......
1602 1603

  
1603 1604
}
1604 1605

  
1606
public static boolean getFilterCommonNameReferences(){
1607
    return getPreferenceStore().getBoolean(PreferencesUtil.FILTER_COMMON_NAME_REFERENCES);
1608
}
1609

  
1605 1610
/**
1606 1611
 *
1607 1612
 */
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractReferencedEntityElement.java
14 14

  
15 15
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
16 16
import eu.etaxonomy.cdm.model.reference.Reference;
17
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
17 18
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
18 19
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
19 20
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
......
64 65
	/** {@inheritDoc} */
65 66
	@Override
66 67
	public void createControls(ICdmFormElement formElement, int style) {
67
	    if (isCommonNameReference){
68
	    if (isCommonNameReference && PreferencesUtil.getFilterCommonNameReferences()){
68 69
	        selection_reference = formFactory
69 70
                    .createCommonNameReferenceSelectionElement(formElement, "Reference",
70 71
                            null, EntitySelectionElement.ALL, style);

Also available in: Unified diff