Project

General

Profile

Revision 05a6f11d

ID05a6f11dee94d089fca533f1228907a1ec1c43fc
Parent 83f2186a
Child 3d9956a8

Added by Katja Luther about 1 year ago

ref #7793: add preference for show taxonnode wizard

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenTaxonEditorForTaxonNodeHandler.java
35 35
     */
36 36
    @Override
37 37
    protected boolean canExecute(TaxonNode entity) {
38
        return entity.getTaxon()!=null;
38
        return entity.getTaxon()!=null ;
39 39
    }
40 40

  
41 41
    @Override
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/GeneralAdminPreferencePage.java
38 38
    boolean isShowIOMenu = true;
39 39
    boolean isShowMediaView = true;
40 40
    boolean isShowCheckListPerspective = false;
41
    boolean isShowTaxonNodeWizard = true;
41 42
    /**
42 43
     * {@inheritDoc}
43 44
     */
......
67 68
            if (isShowChecklistPref != null){
68 69
                this.isShowCheckListPerspective = Boolean.valueOf(isShowChecklistPref.getValue());
69 70
            }
71

  
72
            key = CdmPreference.NewKey(PreferenceSubject.NewDatabaseInstance(), PreferencePredicate.ShowTaxonNodeWizard);
73
            CdmPreference isShowTaxonNodeWizardPref = service.find(key);
74
            if (isShowTaxonNodeWizardPref != null){
75
                this.isShowTaxonNodeWizard = Boolean.valueOf(isShowTaxonNodeWizardPref.getValue());
76
            }
70 77
        }
71 78
        final Button showIOMenuButton = new Button(composite, SWT.CHECK);
72 79

  
......
106 113
              }
107 114
         });
108 115

  
116
        final Button showTaxonNodeWizardButton = new Button(composite, SWT.CHECK);
117

  
118
        showTaxonNodeWizardButton.setText(Messages.DatabasePreferncesPage_Show_TaxonNodeWizard);
119

  
120
        showTaxonNodeWizardButton.setSelection(isShowTaxonNodeWizard);
121
        showTaxonNodeWizardButton.addSelectionListener(new SelectionAdapter(){
122
             @Override
123
             public void widgetSelected(SelectionEvent e) {
124
                 isShowTaxonNodeWizard = showTaxonNodeWizardButton.getSelection();
125

  
126
              }
127
         });
128

  
109 129
        return composite;
110 130
    }
111 131

  
......
130 150
           pref = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowChecklistPerspective, Boolean.toString(this.isShowCheckListPerspective));
131 151
           pref.setAllowOverride(false);
132 152
           service.set(pref);
153
           pref = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowTaxonNodeWizard, Boolean.toString(this.isShowTaxonNodeWizard));
154
           pref.setAllowOverride(false);
155
           service.set(pref);
133 156
           PreferencesUtil.updateDBPreferences();
134 157

  
135 158

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/e4/DefaultOpenTaxonNodeWizardHandlerE4.java
19 19
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
20 20
import eu.etaxonomy.taxeditor.event.EventUtility;
21 21
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
22
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
23
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
22 24
import eu.etaxonomy.taxeditor.store.CdmStore;
23 25
import eu.etaxonomy.taxeditor.ui.section.classification.EditTaxonNodeWizard;
24 26

  
......
47 49

  
48 50
    @Override
49 51
    public boolean canExecute(TaxonNode entity) {
50
        return entity.getTaxon()!=null;
52
        return entity.getTaxon()!=null && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_TAXONNODE_WIZARD);
51 53
    }
52 54

  
53 55
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java
448 448

  
449 449

  
450 450
    public static String DatabasePreferncesPage_Show_MediaView;
451

  
452

  
453 451
    public static String DatabasePreferncesPage_Show_ChecklistPerspective;
452
    public static String DatabasePreferncesPage_Show_TaxonNodeWizard;
454 453

  
455 454
    static {
456 455
        // initialize resource bundle
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
338 338
DatabasePreferncesPage_Show_IOMenu=Show Import/Export menu entries
339 339
Distribution_status_selection=Status Selection
340 340
DatabasePreferncesPage_Show_MediaView=Show Media View
341
DatabasePreferncesPage_Show_ChecklistPerspective=Show Checklist Perspective as default Perspective
341
DatabasePreferncesPage_Show_ChecklistPerspective=Show Checklist Perspective as default Perspective
342
DatabasePreferncesPage_Show_TaxonNodeWizard=Taxon Nodes can be edited in Wizard
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
338 338
Distribution_status_selection=Status Auswahl
339 339
DatabasePreferncesPage_Show_MediaView=Zeige den Media View an
340 340
DatabasePreferncesPage_Show_ChecklistPerspective=Zeige Checklist Perspektive als Default Perspektive an
341
DatabasePreferncesPage_Show_TaxonNodeWizard=Wizard zum Editieren der Taxon Knoten anzeigen
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
245 245

  
246 246
    public static final String SHOW_MEDIA = "eu.etaxonomy.taxeditor.view.showMedia";
247 247
    public static final String SHOW_CHECKLIST_PERSPECTIVE = "eu.etaxonomy.taxeditor.perspective.showChecklist";
248
    public static final String SHOW_TAXONNODE_WIZARD = "eu.etaxonomy.taxeditor.menu.showTaxonNodeWizard";
248 249

  
249 250

  
250 251

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
606 606

  
607 607
		getPreferenceStore().setDefault(FILTER_COMMON_NAME_REFERENCES, false);
608 608
		getPreferenceStore().setDefault(SHOW_SPECIMEN, true);
609
		getPreferenceStore().setDefault(SHOW_TAXONNODE_WIZARD, false);
609 610

  
610 611
	}
611 612

  
......
1710 1711
        }
1711 1712
    }
1712 1713

  
1714
    preference = getPreferenceFromDB(PreferencePredicate.ShowTaxonNodeWizard);
1715
    if (preference != null){
1716
        if (!prefStore.getBoolean(SHOW_TAXONNODE_WIZARD) ||  !preference.isAllowOverride()){
1717
            prefStore.setValue(SHOW_TAXONNODE_WIZARD, preference.getValue());
1718
        }
1719
    }
1720

  
1713 1721
}
1714 1722

  
1715 1723

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/AbstractSpecimenOrObservationDetailElement.java
26 26
	protected void createControls(ICdmFormElement formElement,
27 27
			DerivedUnitFacade entity, int style) {
28 28

  
29
	    setWarnForReferencingObjects(formElement);
29 30
		combo_kindOfUnit= formFactory.createDefinedTermComboElement(TermType.KindOfUnit, formElement, "Kind Of Unit", entity.getDerivedUnitKindOfUnit(), style);
30 31
		combo_lifeStage = formFactory.createDefinedTermComboElement(TermType.Stage, formElement, "Life Stage", entity.getLifeStage(), style);
31 32
		combo_sex = formFactory.createDefinedTermComboElement(TermType.Sex, formElement, "Sex", entity.getSex(),style);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)