Project

General

Profile

Revision 69be3e73

ID69be3e733240df554716a91669b788bd1db09391
Parent cc4e78d1
Child f97f57f1

Added by Katja Luther 9 months ago

ref #7793: add preference to hide all specimen related issues

View differences:

eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/ChecklistPerspective.java
32 32
	public void createInitialLayout(IPageLayout layout) {
33 33
		IFolderLayout navigationFolder = layout.createFolder("navigation",
34 34
				IPageLayout.LEFT, 0.25f, layout.getEditorArea());
35
//
36
//		navigationFolder.addView(NAVIGATOR);
37
//		navigationFolder.addPlaceholder(SEARCH_RESULTS);
38
//        navigationFolder.addPlaceholder(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_DESCRIPTIVEDATASET_DESCRIPTIVEDATASETNAVIGATOR);
39
//
40
//		IFolderLayout folder = layout.createFolder("Folder", IPageLayout.BOTTOM, 0.6f, layout.getEditorArea());
41
//		folder.addView(FACTUAL_DATA_VIEW);
42
//		folder.addView(DETAILS_VIEW);
43
//		folder.addView(MediaViewPart.ID);
44

  
45
//		createAdditionalFolder(layout, layout.getEditorArea());
46

  
47 35

  
48 36
		navigationFolder.addView(NAVIGATOR);
49 37
        navigationFolder.addPlaceholder(SEARCH_RESULTS);
eu.etaxonomy.taxeditor.editor/fragment.e4xmi
423 423
    <elements xsi:type="commands:Handler" xmi:id="_KxUSAE3pEeivZbtHG8C6kA" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.OpenDerivativeEditorForDescriptionElement" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.OpenDerivativeEditorForDescriptionElement" command="_j2cfsJMmEeeR4YRjNqCKeA"/>
424 424
  </fragments>
425 425
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_OyvD8KNOEee5fYT78qEx0A" featurename="children" parentElementId="bulkeditor.menus.openmenu" positionInList="last">
426
    <elements xsi:type="menu:HandledMenuItem" xmi:id="_SZZBkKNOEee5fYT78qEx0A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.specimen_editor" label="%command.label.DERIVATIVE_EDITOR" tooltip="%command.label.DERIVATIVE_EDITOR" command="_PDjFMLsKEeeQJq8FDGEi1g"/>
426
    <elements xsi:type="menu:HandledMenuItem" xmi:id="_SZZBkKNOEee5fYT78qEx0A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.specimen_editor" label="%command.label.DERIVATIVE_EDITOR" tooltip="%command.label.DERIVATIVE_EDITOR" command="_PDjFMLsKEeeQJq8FDGEi1g">
427
      <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_JmrHoMyMEeiaBbSMdwpwIg" coreExpressionId="isShowSpecimenMenuEnabled"/>
428
    </elements>
427 429
  </fragments>
428 430
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_Fw06MKz0EeeBIsZyvYlAaA" featurename="children" parentElementId="eu.etaxonomy.taxeditor.bulkeditor.popupmenu.bulkeditor" positionInList="after:eu.etaxonomy.taxeditor.bulkeditor.menuseparator.afterNew">
429 431
    <elements xsi:type="menu:HandledMenuItem" xmi:id="_JzLVUKz0EeeBIsZyvYlAaA" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.command.name34" label="%command.name.34" command="_cxTosKzzEeeBIsZyvYlAaA"/>
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
159 159
            }
160 160
        }
161 161
        MPart part = showPart(NAME_EDITOR_ID, modelService, partService, application);
162

  
162 163
        TaxonNameEditorE4 editor = (TaxonNameEditorE4) part.getObject();
163 164
        editor.init(input);
164 165
    }
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForTaxonNode.java
18 18
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
19 19
import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
20 20
import eu.etaxonomy.taxeditor.handler.defaultHandler.e4.DefaultOpenHandlerBaseE4;
21
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
22
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
21 23
import eu.etaxonomy.taxeditor.store.CdmStore;
22 24

  
23 25
public class OpenDerivativeEditorForTaxonNode extends DefaultOpenHandlerBaseE4<TaxonNode> {
......
48 50
     */
49 51
    @Override
50 52
    protected boolean canExecute(TaxonNode entity) {
51
        return entity.getTaxon()!=null;
53
        return (entity.getTaxon()!=null && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SPECIMEN));
52 54
    }
53 55

  
54 56
    @Override
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java
38 38
import eu.etaxonomy.cdm.model.description.IDescribable;
39 39
import eu.etaxonomy.cdm.model.name.TaxonName;
40 40
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
41
import eu.etaxonomy.cdm.model.taxon.Taxon;
42 41
import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditorE4;
43 42
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
44 43
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
45
import eu.etaxonomy.taxeditor.editor.view.checklist.e4.ChecklistEditorE4;
46 44
import eu.etaxonomy.taxeditor.editor.view.concept.e4.ConceptViewPartE4;
47 45
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDragListener;
48 46
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDropAdapter;
......
128 126
            // description selected in this view
129 127
            return;
130 128
        }
129
//        if(partObject instanceof ChecklistEditorE4){
130
//            IWorkbenchPage page = PlatformUI.getWorkbench()
131
//                    .getActiveWorkbenchWindow().getActivePage();
132
//            page.hideView(page.findView("eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4"));
133
//        }
131 134

  
132 135
        if(partObject instanceof IPartContentHasFactualData){
133 136
            if (!viewer.getControl().isDisposed()){
......
138 141
                showEmptyPage();
139 142
                return;
140 143
            }
141
            if(partObject instanceof ChecklistEditorE4){
142
                if(structuredSelection.getFirstElement() instanceof Taxon){
143
                    Taxon taxon = (Taxon)structuredSelection.getFirstElement();
144
                    structuredSelection = new StructuredSelection(taxon);
145
                }
146
            }
144

  
147 145
            Object firstElement = structuredSelection.getFirstElement();
148 146
            if (partObject instanceof TaxonNameEditorE4){
149 147
                if (firstElement != ((TaxonNameEditorE4)partObject).getTaxon()){
eu.etaxonomy.taxeditor.store/plugin.xml
100 100
         class="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester"
101 101
         id="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester"
102 102
         namespace="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester"
103
         properties="isShowExperimentalFeatures, isChecklistEditorEnabled, isShowIOMenuEnabled"
103
         properties="isShowExperimentalFeatures, isChecklistEditorEnabled, isShowIOMenuEnabled, isShowSpecimenMenuEnabled"
104 104
         type="java.lang.Object">
105 105
   </propertyTester>
106 106
   <propertyTester
......
151 151
      </test>
152 152
   </definition>
153 153
   <definition
154
         id="isShowSpecimenMenuEnabled">
155
      <test
156
            property="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester.isShowSpecimenMenuEnabled">
157
      </test>
158
   </definition>
159
   <definition
154 160
         id="isModifiable">
155 161
      <with
156 162
            variable="selection">
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/SpecimenAdminPreferences.java
209 209
            CdmPreference pref = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowCollectingAreasInGeneralSection, Boolean.toString(this.isShowCollectingAreaInGeneralSection));
210 210
            pref.setAllowOverride(isUseLocalPreference);
211 211
            service.set(pref);
212
            pref = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowSpecimen, Boolean.toString(this.isShowSpecimenRelatedIssues));
213
            pref.setAllowOverride(isUseLocalPreference);
214
            service.set(pref);
212 215

  
213 216
            pref = CdmPreference.NewDatabaseInstance(PreferencePredicate.DeterminationOnlyForFieldUnits, Boolean.toString(this.isDeterminationOnlyForFieldUnits));
214 217
            pref.setAllowOverride(isUseLocalPreference);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencePropertyTester.java
25 25

  
26 26
    private static final String SHOW_IO_MENU = "isShowIOMenuEnabled";
27 27

  
28
    private static final String SHOW_SPECIMEN_MENU = "isShowSpecimenMenuEnabled";
29

  
28 30
	@Override
29 31
	public boolean test(Object receiver, String property, Object[] args,
30 32
			Object expectedValue) {
......
37 39
	    if(SHOW_IO_MENU.equals(property)){
38 40
            return isShowIOMenuEnabled();
39 41
        }
42
	    if(SHOW_SPECIMEN_MENU.equals(property)){
43
            return isShowSpecimenMenuEnabled();
44
        }
40 45
		return false;
41 46
	}
42 47

  
......
54 59
        return PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_IO_MENU);
55 60
    }
56 61

  
62
	private boolean isShowSpecimenMenuEnabled() {
63
        return PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SPECIMEN);
64
    }
65

  
57 66
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)