more changes for configurable name details view
authorKatja Luther <k.luther@bgbm.org>
Mon, 19 Dec 2016 15:16:46 +0000 (16:16 +0100)
committerKatja Luther <k.luther@bgbm.org>
Mon, 19 Dec 2016 15:16:46 +0000 (16:16 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java

index 1f92bf6c3104376cf8c9ea43565bd8fe889a7ce0..25ad03df76df6319fee3ed2f628beec560ada506 100644 (file)
@@ -173,7 +173,7 @@ public interface IPreferenceKeys {
     public static final String SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP = "eu.etaxonomy.taxeditor.name.showNameNameRelationship";
        public static final String SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE = "eu.etaxonomy.taxeditor.name.showNameAppendedPhrase";
        public static final String SHOW_NAME_DETAILS_SECTION_CACHE = "eu.etaxonomy.taxeditor.name.showNameCache";
-
+    public static final String SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE = "eu.etaxonomy.taxeditor.name.showAuthorCache";
     public static final String PROMPT_FOR_OPEN_SPECIMEN_IN_EDITOR = "eu.etaxonomy.taxeditor.specimen.promptForOpenSpecimenInEditor";
 
     // TODO RL
@@ -187,6 +187,8 @@ public interface IPreferenceKeys {
      * Key for the saved P2 repositories
      */
     public static final String P2_REPOSITORY_LIST = "eu.etaxonomy.taxeditor.p2.repositories";
+    public static final String ALLOW_OVERRIDE_NAMEDETAILS = "eu.etaxonomy.taxeditor.details.allow_override";
+
 
 
 
index 044268570adc898eb3e8b5f302cdf3475aae56f4..be4133108e7c0f4fde63df782d8fb7a3039f38c9 100644 (file)
@@ -67,7 +67,7 @@ public class AuthorshipDetailElement extends
        @Override
        protected void createControls(ICdmFormElement formElement,
                        NonViralName entity, int style) {
-           if (isAdvancedView){
+           if (isAdvancedView || PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE)){
                toggleable_cache = formFactory.createToggleableTextField(this,
                                "Authorship Cache", entity.getAuthorshipCache(),
                                entity.isProtectedAuthorshipCache(), style);
@@ -78,42 +78,43 @@ public class AuthorshipDetailElement extends
            }
            NomenclaturalCode code = entity.getNomenclaturalCode();
 
-        selectionCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
-                               getConversationHolder(),
-                               formElement, "Author",
-                               entity.getCombinationAuthorship(),
-                               EntitySelectionElement.ALL, style);
-               addElement(selectionCombinationAuthor);
-               selectionExCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
-                               getConversationHolder(),
-                               formElement, "Ex Author",
-                               entity.getExCombinationAuthorship(),
-                               EntitySelectionElement.ALL, style);
-               addElement(selectionExCombinationAuthor);
-               if (code != null){
-            if (code.equals(NomenclaturalCode.ICZN)){
-                text_publicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Publication Year", ((ZoologicalName)entity).getPublicationYear(), style);
-
-            }
-         }
-               selectionBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
-                formElement, "Basionym Author", entity.getBasionymAuthorship(),
-                EntitySelectionElement.ALL, style);
-               addElement(selectionBasionymAuthor);
-               selectionExBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
-                       formElement, "Ex Basionym Author",entity.getExBasionymAuthorship(),
-                       EntitySelectionElement.ALL, style);
-
-               addElement(selectionExBasionymAuthor);
-                if (code != null){
-                   if (code.equals(NomenclaturalCode.ICZN)){
-
-                       text_originalPublicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Orig. Publication Year", ((ZoologicalName)entity).getOriginalPublicationYear(), style);
-
-                   }
-                }
-
+           if (isAdvancedView || PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP)){
+            selectionCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
+                               getConversationHolder(),
+                               formElement, "Author",
+                               entity.getCombinationAuthorship(),
+                               EntitySelectionElement.ALL, style);
+               addElement(selectionCombinationAuthor);
+               selectionExCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
+                               getConversationHolder(),
+                               formElement, "Ex Author",
+                               entity.getExCombinationAuthorship(),
+                               EntitySelectionElement.ALL, style);
+               addElement(selectionExCombinationAuthor);
+               if (code != null){
+                if (code.equals(NomenclaturalCode.ICZN)){
+                    text_publicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Publication Year", ((ZoologicalName)entity).getPublicationYear(), style);
+
+                }
+             }
+               selectionBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
+                    formElement, "Basionym Author", entity.getBasionymAuthorship(),
+                    EntitySelectionElement.ALL, style);
+               addElement(selectionBasionymAuthor);
+               selectionExBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
+                       formElement, "Ex Basionym Author",entity.getExBasionymAuthorship(),
+                       EntitySelectionElement.ALL, style);
+
+               addElement(selectionExBasionymAuthor);
+                if (code != null){
+                   if (code.equals(NomenclaturalCode.ICZN)){
+
+                       text_originalPublicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Orig. Publication Year", ((ZoologicalName)entity).getOriginalPublicationYear(), style);
+
+                   }
+                }
 
+           }
 
        }
 
index ca153c81fdc5dab9f4a56127b80cb701afb78e88..9387c20dbc85579518920f43cce86ad3decdf23d 100644 (file)
@@ -80,27 +80,33 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
 
            if (isAdvancedView){
                toggleable_cache = formFactory.createToggleableTextField(this, "Name Cache", nonViralName.getNameCache(), nonViralName.isProtectedNameCache(), style);
+               combo_rank = formFactory.createDefinedTermComboElement(TermType.Rank, this, "Rank", nonViralName.getRank(), style);
+               createGenusOrUninomialControls(this, nonViralName, style);
+            createInfragenerericEpithetControls(this, nonViralName, style);
+            createSpecificEpithetControls(this, nonViralName, style);
+            createInfraSpecificEpithetControls(this, nonViralName, style);
+            createSpecificNameParts(this, nonViralName, style);
+            text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style);
            }else{
                if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE)){
                        toggleable_cache = formFactory.createToggleableTextField(this, "Name Cache", nonViralName.getNameCache(), nonViralName.isProtectedNameCache(), style);
                }
+
+           if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK)){
+               combo_rank = formFactory.createDefinedTermComboElement(TermType.Rank, this, "Rank", nonViralName.getRank(), style);
+           }
+
+               if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS)){
+                       createGenusOrUninomialControls(this, nonViralName, style);
+                       createInfragenerericEpithetControls(this, nonViralName, style);
+                       createSpecificEpithetControls(this, nonViralName, style);
+                       createInfraSpecificEpithetControls(this, nonViralName, style);
+                       createSpecificNameParts(this, nonViralName, style);
+               }
+               if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE)){
+                               text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style);
+               }
            }
-               combo_rank = formFactory.createDefinedTermComboElement(TermType.Rank, this, "Rank", nonViralName.getRank(), style);
-               if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS)){
-                       createGenusOrUninomialControls(this, nonViralName, style);
-                       createInfragenerericEpithetControls(this, nonViralName, style);
-                       createSpecificEpithetControls(this, nonViralName, style);
-                       createInfraSpecificEpithetControls(this, nonViralName, style);
-                       createSpecificNameParts(this, nonViralName, style);
-               }
-               if (isAdvancedView){
-                   //createSpecificNameParts(this, nonViralName, style);
-                       text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style);
-               }else{
-                       if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE)){
-                               text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style);
-               }
-               }
        }
 
        /**
index 23fe4db93d8564c53a15e1016e5cd33ae05b022e..1b306cbc0368cb9de80493ae76f33dcffdde7633 100644 (file)
@@ -76,14 +76,14 @@ public class NonViralNameDetailElement extends
                        combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
                         if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
                                  combo_nomenclaturalCode.setVisible(false);
-                 } 
+                 }
                }
                if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID)){
                        textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style);
-                       
+
                }
-                       
-               
+
+
         }
 
 
@@ -91,28 +91,20 @@ public class NonViralNameDetailElement extends
            section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            addControl(section_name);
            addElement(section_name);
-           section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-           section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-           addControl(section_author);
-           addElement(section_author);
-
+           if (isAdvancedView || PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP)){
+           section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+           section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+           addControl(section_author);
+           addElement(section_author);
+           }
            //TODO RL
-           if (isAdvancedView){
+           if (isAdvancedView || PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID)){
            if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
                section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
                section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                addControl(section_hybrid);
                addElement(section_hybrid);
            }
-        }else{
-                if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
-                        if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID)){
-                       section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
-                       section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-                       addControl(section_hybrid);
-                       addElement(section_hybrid);
-                        }
-           }
         }
 
 
index 420fcbef815e4eb38a8edb75bf6c0b65251c1b57..fcf2e95d2d6b339f6b04aabb2f061420604775d9 100644 (file)
@@ -278,7 +278,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
             else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.TissueSample){
                 //TissueSample should only be created by using it's own class
                 //in future using only one class with different SpecimenOrObservationTypes is desired
-//                createTissueSampleSection(rootElement);
+                createTissueSampleSection(rootElement);
             }
             else{
                 createDerivedUnitBaseElementSection(rootElement);