- added not covered switch cases in NameDetailElement
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 21 Oct 2013 11:24:06 +0000 (11:24 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 21 Oct 2013 11:24:06 +0000 (11:24 +0000)
 - commented null pointer access in UseObjectManager (FIXME 3.3M)

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/UseObjectManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java

index a12ebd3bff02dd4eb79fba7479f888adce284649..5ede554fcda2bcd27f45091303e78861f26d986a 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2011 EDIT\r
 /**\r
 * Copyright (C) 2011 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -31,58 +31,58 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
 \r
 /**\r
  * The context listener will call this class when the uses view is being loaded.\r
 \r
 /**\r
  * The context listener will call this class when the uses view is being loaded.\r
- * It checks if the uses view's necessary terms are present in the database. \r
- * It will persist the terms that aren't present, using the CDMLib's services classes. \r
- * @author a.theys     \r
+ * It checks if the uses view's necessary terms are present in the database.\r
+ * It will persist the terms that aren't present, using the CDMLib's services classes.\r
+ * @author a.theys\r
  * @created mar 13, 2012\r
  * @version 1.0\r
  */\r
 public class UseObjectManager extends ContextListenerAdapter{\r
  * @created mar 13, 2012\r
  * @version 1.0\r
  */\r
 public class UseObjectManager extends ContextListenerAdapter{\r
-       \r
-       \r
+\r
+\r
        @Override\r
        public void contextRefresh(IProgressMonitor monitor) {\r
                monitor.subTask("Refreshing the Uses View");\r
                StoreUtil.warn(getClass(), "Refreshing Uses View warn");\r
                setupNecessaryItems(monitor);\r
        }\r
        @Override\r
        public void contextRefresh(IProgressMonitor monitor) {\r
                monitor.subTask("Refreshing the Uses View");\r
                StoreUtil.warn(getClass(), "Refreshing Uses View warn");\r
                setupNecessaryItems(monitor);\r
        }\r
-       \r
-       \r
+\r
+\r
        @Override\r
        public void contextStart(IMemento memento, IProgressMonitor monitor) {\r
                monitor.subTask("Starting the Uses View");\r
                StoreUtil.warn(getClass(), "Starting Uses View warn");\r
                setupNecessaryItems(monitor);\r
        }\r
        @Override\r
        public void contextStart(IMemento memento, IProgressMonitor monitor) {\r
                monitor.subTask("Starting the Uses View");\r
                StoreUtil.warn(getClass(), "Starting Uses View warn");\r
                setupNecessaryItems(monitor);\r
        }\r
-       \r
+\r
        private void setupNecessaryItems(IProgressMonitor monitor) {\r
        private void setupNecessaryItems(IProgressMonitor monitor) {\r
-               \r
+\r
                //retrieve terms and vocabularies from db\r
                Feature featureUseRecord = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseRecordFeature);\r
                Feature featureUseSummary = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseSummaryFeature);\r
                //retrieve terms and vocabularies from db\r
                Feature featureUseRecord = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseRecordFeature);\r
                Feature featureUseSummary = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseSummaryFeature);\r
-               \r
+\r
                ConversationHolder conversation = CdmStore.createConversation();\r
                ConversationHolder conversation = CdmStore.createConversation();\r
-               \r
-               \r
+\r
+\r
                //create use marker type if not exists\r
                createUseMarkerType(conversation);\r
                //create use marker type if not exists\r
                createUseMarkerType(conversation);\r
-               \r
+\r
                //create state vocabulary if not exists\r
                createStateVocabulary(monitor, conversation);\r
                //create state vocabulary if not exists\r
                createStateVocabulary(monitor, conversation);\r
-                       \r
+\r
                //create state vocabulary if not exists\r
                createCountryVocabulary(monitor, conversation);\r
                //create state vocabulary if not exists\r
                createCountryVocabulary(monitor, conversation);\r
-               \r
+\r
                //create plant part vocabulary\r
                createPlantVocabulary(monitor, conversation);\r
                //create plant part vocabulary\r
                createPlantVocabulary(monitor, conversation);\r
-               \r
+\r
                //create human group vocabulary\r
                createHumanGroupVocabulary(monitor, conversation);\r
                //create human group vocabulary\r
                createHumanGroupVocabulary(monitor, conversation);\r
-               \r
+\r
                if(featureUseRecord == null || featureUseSummary == null) {\r
                if(featureUseRecord == null || featureUseSummary == null) {\r
-                       TermVocabulary<Feature> featureVocabulary = (TermVocabulary<Feature>)CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidFeatureVocabulary));\r
+                       TermVocabulary<Feature> featureVocabulary = CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidFeatureVocabulary));\r
                        FeatureTree palmWebFeatureTree = CdmStore.getService(IFeatureTreeService.class).find(UsageTermCollection.uuidPalmWebFeatureTree);\r
                        FeatureTree palmWebFeatureTree = CdmStore.getService(IFeatureTreeService.class).find(UsageTermCollection.uuidPalmWebFeatureTree);\r
-                       \r
+\r
                        if (featureUseRecord == null ) {\r
                                featureUseRecord = Feature.NewInstance(UsageTermCollection.useRecordFeatureLabel, UsageTermCollection.useRecordFeatureLabel, null);\r
                                featureUseRecord.setUuid(UsageTermCollection.uuidUseRecordFeature);\r
                        if (featureUseRecord == null ) {\r
                                featureUseRecord = Feature.NewInstance(UsageTermCollection.useRecordFeatureLabel, UsageTermCollection.useRecordFeatureLabel, null);\r
                                featureUseRecord.setUuid(UsageTermCollection.uuidUseRecordFeature);\r
@@ -109,20 +109,20 @@ public class UseObjectManager extends ContextListenerAdapter{
                                        StoreUtil.warn(getClass(), "No current feature tree available to add use summary feature");\r
                                }\r
                        }\r
                                        StoreUtil.warn(getClass(), "No current feature tree available to add use summary feature");\r
                                }\r
                        }\r
-                       \r
+\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(featureVocabulary);\r
                        if (palmWebFeatureTree != null){\r
                                CdmStore.getService(IFeatureTreeService.class).saveOrUpdate(palmWebFeatureTree);\r
                        }\r
                        conversation.commit(true);\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(featureVocabulary);\r
                        if (palmWebFeatureTree != null){\r
                                CdmStore.getService(IFeatureTreeService.class).saveOrUpdate(palmWebFeatureTree);\r
                        }\r
                        conversation.commit(true);\r
-                       \r
+\r
                }\r
                }\r
-               conversation.close();   \r
+               conversation.close();\r
        }\r
 \r
 \r
        private void createHumanGroupVocabulary(IProgressMonitor monitor,ConversationHolder conversation) {\r
        }\r
 \r
 \r
        private void createHumanGroupVocabulary(IProgressMonitor monitor,ConversationHolder conversation) {\r
-               TermVocabulary<DefinedTerm> humanGroupVocabulary =  (TermVocabulary<DefinedTerm>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidHumanGroupVocabulary);\r
+               TermVocabulary<DefinedTerm> humanGroupVocabulary =  CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidHumanGroupVocabulary);\r
                if (humanGroupVocabulary == null){\r
                        monitor.subTask("create human group vocabulary");\r
                        URI termSourceUri = null;\r
                if (humanGroupVocabulary == null){\r
                        monitor.subTask("create human group vocabulary");\r
                        URI termSourceUri = null;\r
@@ -131,27 +131,24 @@ public class UseObjectManager extends ContextListenerAdapter{
                        } catch (URISyntaxException e) {\r
                                e.printStackTrace();\r
                        }\r
                        } catch (URISyntaxException e) {\r
                                e.printStackTrace();\r
                        }\r
-                       \r
+\r
                        //FIXME:3.3MC----\r
                        //humanGroupVocabulary = TermVocabulary.NewInstance(UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri);\r
                        //FIXME:3.3MC----\r
                        //humanGroupVocabulary = TermVocabulary.NewInstance(UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri);\r
-                       humanGroupVocabulary = null;\r
-                       humanGroupVocabulary.setUuid(UsageTermCollection.uuidHumanGroupVocabulary);\r
+//                     humanGroupVocabulary.setUuid(UsageTermCollection.uuidHumanGroupVocabulary);\r
                        //FIXME:3.3MC----\r
                        //FIXME:3.3MC----\r
-                       \r
+\r
                        //FIXME:3.3MC----\r
                        //DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
                        //FIXME:3.3MC----\r
                        //DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
-                       DefinedTerm newDummyModifier = null;\r
-                       newDummyModifier.setUuid(UsageTermCollection.uuidHumanGroupDummy);\r
+//                     newDummyModifier.setUuid(UsageTermCollection.uuidHumanGroupDummy);\r
                        //FIXME:3.3MC----\r
                        //FIXME:3.3MC----\r
-                       \r
+\r
                        //FIXME:3.3MC----\r
                        //DefinedTerm newSubDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
                        //FIXME:3.3MC----\r
                        //DefinedTerm newSubDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
-                       DefinedTerm newSubDummyModifier = null;\r
-                       newSubDummyModifier.setUuid(UsageTermCollection.uuidEthnicGroupDummy);\r
+//                     newSubDummyModifier.setUuid(UsageTermCollection.uuidEthnicGroupDummy);\r
+//                     newDummyModifier.addIncludes(newSubDummyModifier);\r
+//                     humanGroupVocabulary.addTerm(newDummyModifier);\r
                        //FIXME:3.3MC----\r
                        //FIXME:3.3MC----\r
-                       \r
-                       newDummyModifier.addIncludes(newSubDummyModifier);\r
-                       humanGroupVocabulary.addTerm(newDummyModifier);\r
+\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(humanGroupVocabulary);\r
                        conversation.commit(true);\r
                }\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(humanGroupVocabulary);\r
                        conversation.commit(true);\r
                }\r
@@ -159,7 +156,7 @@ public class UseObjectManager extends ContextListenerAdapter{
 \r
 \r
        private void createPlantVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
 \r
 \r
        private void createPlantVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
-               TermVocabulary<DefinedTerm> plantPartVocabulary =  (TermVocabulary<DefinedTerm>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidPlantPartVocabulary);\r
+               TermVocabulary<DefinedTerm> plantPartVocabulary =  CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidPlantPartVocabulary);\r
                if (plantPartVocabulary == null){\r
                        monitor.subTask("create plant part vocabulary");\r
                        URI termSourceUri = null;\r
                if (plantPartVocabulary == null){\r
                        monitor.subTask("create plant part vocabulary");\r
                        URI termSourceUri = null;\r
@@ -170,17 +167,15 @@ public class UseObjectManager extends ContextListenerAdapter{
                        }\r
                        //FIXME:3.3MC----\r
                        //plantPartVocabulary = TermVocabulary.NewInstance(UsageTermCollection.plantPartLabel, UsageTermCollection.plantPartLabel, null, termSourceUri);\r
                        }\r
                        //FIXME:3.3MC----\r
                        //plantPartVocabulary = TermVocabulary.NewInstance(UsageTermCollection.plantPartLabel, UsageTermCollection.plantPartLabel, null, termSourceUri);\r
-                       plantPartVocabulary = null;\r
-                       plantPartVocabulary.setUuid(UsageTermCollection.uuidPlantPartVocabulary);\r
+//                     plantPartVocabulary.setUuid(UsageTermCollection.uuidPlantPartVocabulary);\r
                        //FIXME:3.3MC----\r
                        //FIXME:3.3MC----\r
-                       \r
+\r
                        //FIXME:3.3MC----\r
                        //DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
                        //FIXME:3.3MC----\r
                        //DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
-                       DefinedTerm newDummyModifier = null;\r
-                       newDummyModifier.setUuid(UsageTermCollection.uuidPlantPartDummy);\r
-                       plantPartVocabulary.addTerm(newDummyModifier);\r
+//                     newDummyModifier.setUuid(UsageTermCollection.uuidPlantPartDummy);\r
+//                     plantPartVocabulary.addTerm(newDummyModifier);\r
                        //FIXME:3.3MC----\r
                        //FIXME:3.3MC----\r
-                       \r
+\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(plantPartVocabulary);\r
                        conversation.commit(true);\r
                }\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(plantPartVocabulary);\r
                        conversation.commit(true);\r
                }\r
@@ -188,7 +183,7 @@ public class UseObjectManager extends ContextListenerAdapter{
 \r
 \r
        private void createCountryVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
 \r
 \r
        private void createCountryVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
-               TermVocabulary<DefinedTerm> countryVocabulary =  (TermVocabulary<DefinedTerm>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidCountryVocabulary);\r
+               TermVocabulary<DefinedTerm> countryVocabulary =  CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidCountryVocabulary);\r
                if (countryVocabulary == null){\r
                        monitor.subTask("create country vocabulary");\r
                        URI termSourceUri = null;\r
                if (countryVocabulary == null){\r
                        monitor.subTask("create country vocabulary");\r
                        URI termSourceUri = null;\r
@@ -199,16 +194,14 @@ public class UseObjectManager extends ContextListenerAdapter{
                        }\r
                        //FIXME:3.3MC----\r
                        //countryVocabulary = TermVocabulary.NewInstance(UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri);\r
                        }\r
                        //FIXME:3.3MC----\r
                        //countryVocabulary = TermVocabulary.NewInstance(UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri);\r
-                       countryVocabulary = null;\r
-                       countryVocabulary.setUuid(UsageTermCollection.uuidCountryVocabulary);\r
+//                     countryVocabulary.setUuid(UsageTermCollection.uuidCountryVocabulary);\r
                        //FIXME:3.3MC----\r
                        //FIXME:3.3MC----\r
-                       \r
+\r
                        //FIXME:3.3MC----\r
                        //DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
                        //FIXME:3.3MC----\r
                        //DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
-                       DefinedTerm newDummyModifier = null;\r
-                       newDummyModifier.setUuid(UsageTermCollection.uuidCountryDummy);\r
+//                     newDummyModifier.setUuid(UsageTermCollection.uuidCountryDummy);\r
+//                     countryVocabulary.addTerm(newDummyModifier);\r
                        //FIXME:3.3MC----\r
                        //FIXME:3.3MC----\r
-                       countryVocabulary.addTerm(newDummyModifier);\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(countryVocabulary);\r
                        conversation.commit(true);\r
                }\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(countryVocabulary);\r
                        conversation.commit(true);\r
                }\r
@@ -216,7 +209,7 @@ public class UseObjectManager extends ContextListenerAdapter{
 \r
 \r
        private void createStateVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
 \r
 \r
        private void createStateVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
-               TermVocabulary<State> stateVocabulary =  (TermVocabulary<State>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidUseCategoryVocabulary);\r
+               TermVocabulary<State> stateVocabulary =  CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidUseCategoryVocabulary);\r
                if (stateVocabulary == null){\r
                        monitor.subTask("create state vocabulary");\r
                        URI termSourceUri = null;\r
                if (stateVocabulary == null){\r
                        monitor.subTask("create state vocabulary");\r
                        URI termSourceUri = null;\r
@@ -227,15 +220,16 @@ public class UseObjectManager extends ContextListenerAdapter{
                        }\r
                        //FIXME:3.3MC----\r
                        //stateVocabulary = TermVocabulary.NewInstance(UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri);\r
                        }\r
                        //FIXME:3.3MC----\r
                        //stateVocabulary = TermVocabulary.NewInstance(UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri);\r
-                       stateVocabulary = null;\r
-                       stateVocabulary.setUuid(UsageTermCollection.uuidUseCategoryVocabulary);\r
+//                     stateVocabulary.setUuid(UsageTermCollection.uuidUseCategoryVocabulary);\r
                        //FIXME:3.3MC----\r
                        State newDummyState = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
                        newDummyState.setUuid(UsageTermCollection.uuidUseCategoryDummy);\r
                        State newDummySubCat = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
                        newDummySubCat.setUuid(UsageTermCollection.uuidUseSubCategoryDummy);\r
                        newDummyState.addIncludes(newDummySubCat);\r
                        //FIXME:3.3MC----\r
                        State newDummyState = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
                        newDummyState.setUuid(UsageTermCollection.uuidUseCategoryDummy);\r
                        State newDummySubCat = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
                        newDummySubCat.setUuid(UsageTermCollection.uuidUseSubCategoryDummy);\r
                        newDummyState.addIncludes(newDummySubCat);\r
-                       stateVocabulary.addTerm(newDummyState);\r
+                       //FIXME:3.3MC----\r
+//                     stateVocabulary.addTerm(newDummyState);\r
+                       //FIXME:3.3MC----\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(stateVocabulary);\r
                        conversation.commit(true);\r
                }\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(stateVocabulary);\r
                        conversation.commit(true);\r
                }\r
@@ -247,7 +241,7 @@ public class UseObjectManager extends ContextListenerAdapter{
                if (useMarkertype == null){\r
                        useMarkertype = MarkerType.NewInstance(UsageTermCollection.useMakerLabel, UsageTermCollection.useMakerLabel, null);\r
                        useMarkertype.setUuid( UsageTermCollection.uuidUseMarkerType);\r
                if (useMarkertype == null){\r
                        useMarkertype = MarkerType.NewInstance(UsageTermCollection.useMakerLabel, UsageTermCollection.useMakerLabel, null);\r
                        useMarkertype.setUuid( UsageTermCollection.uuidUseMarkerType);\r
-                       TermVocabulary<MarkerType> markerTypeVocabulary = (TermVocabulary<MarkerType>)CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidMarkersVocabulary));\r
+                       TermVocabulary<MarkerType> markerTypeVocabulary = CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidMarkersVocabulary));\r
                        markerTypeVocabulary.addTerm(useMarkertype);\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(markerTypeVocabulary);\r
                        conversation.commit(true);\r
                        markerTypeVocabulary.addTerm(useMarkertype);\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(markerTypeVocabulary);\r
                        conversation.commit(true);\r
index 0b4d91728e2750b88ae0ce417796878e14d1af92..d13534adb4ddf93fbb3ea42fca43b8006560bdd1 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -12,6 +12,7 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import java.util.Arrays;
 
 
 import java.util.Arrays;
 
+import org.apache.log4j.Logger;
 import org.eclipse.swt.SWT;
 
 import eu.etaxonomy.cdm.model.name.BotanicalName;
 import org.eclipse.swt.SWT;
 
 import eu.etaxonomy.cdm.model.name.BotanicalName;
@@ -40,6 +41,8 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement
  */
 public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<NonViralName> implements ISelectableElement, IEnableableFormElement{
 
  */
 public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<NonViralName> implements ISelectableElement, IEnableableFormElement{
 
+    private final Logger logger = Logger.getLogger(NameDetailElement.class);
+
        private TermComboElement<Rank> combo_rank;
        private TextWithLabelElement text_appendedPhrase;
        private TextWithLabelElement text_uninomial;
        private TermComboElement<Rank> combo_rank;
        private TextWithLabelElement text_appendedPhrase;
        private TextWithLabelElement text_uninomial;
@@ -52,7 +55,7 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
        private NumberWithLabelElement text_publicationYear;
        private NumberWithLabelElement text_originalPublicationYear;
        private int cursorPosition;
        private NumberWithLabelElement text_publicationYear;
        private NumberWithLabelElement text_originalPublicationYear;
        private int cursorPosition;
-       
+
        /**
         * <p>Constructor for NameDetailElement.</p>
         *
        /**
         * <p>Constructor for NameDetailElement.</p>
         *
@@ -72,20 +75,20 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
        /** {@inheritDoc} */
        @Override
        protected void createControls(ICdmFormElement formElement, NonViralName nonViralName, int style) {
        /** {@inheritDoc} */
        @Override
        protected void createControls(ICdmFormElement formElement, NonViralName nonViralName, int style) {
-               
+
                toggleable_cache = formFactory.createToggleableTextField(this, "Name Cache", nonViralName.getNameCache(), nonViralName.isProtectedNameCache(), style);
                toggleable_cache = formFactory.createToggleableTextField(this, "Name Cache", nonViralName.getNameCache(), nonViralName.isProtectedNameCache(), style);
-               
+
                combo_rank = formFactory.createTermComboElement(Rank.class, this, "Rank", nonViralName.getRank(), style);
                combo_rank = formFactory.createTermComboElement(Rank.class, this, "Rank", nonViralName.getRank(), style);
-               
+
                createGenusOrUninomialControls(this, nonViralName, style);
                createInfragenerericEpithetControls(this, nonViralName, style);
                createSpecificEpithetControls(this, nonViralName, style);
                createInfraSpecificEpithetControls(this, nonViralName, style);
                createGenusOrUninomialControls(this, nonViralName, style);
                createInfragenerericEpithetControls(this, nonViralName, style);
                createSpecificEpithetControls(this, nonViralName, style);
                createInfraSpecificEpithetControls(this, nonViralName, style);
-               
+
                createSpecificNameParts(this, nonViralName, style);
                createSpecificNameParts(this, nonViralName, style);
-               
+
                text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style);
                text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style);
-               
+
        }
 
        /**
        }
 
        /**
@@ -94,22 +97,22 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
        protected void clearCheckRankWarnings() {
                if(getEntity().hasProblem(ParserProblem.CheckRank)){
                        getEntity().removeParsingProblem(ParserProblem.CheckRank);
        protected void clearCheckRankWarnings() {
                if(getEntity().hasProblem(ParserProblem.CheckRank)){
                        getEntity().removeParsingProblem(ParserProblem.CheckRank);
-                       
+
                        // FIXME this has to be reafctored completely. See tickets #1959, #1663, #1957, #1958
 //                     TaxonNameEditor nameEditor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(Page.NAME);
 //                     nameEditor.getSelectedContainer().getNameViewer().clearErrors();
                }
        }
                        // FIXME this has to be reafctored completely. See tickets #1959, #1663, #1957, #1958
 //                     TaxonNameEditor nameEditor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(Page.NAME);
 //                     nameEditor.getSelectedContainer().getNameViewer().clearErrors();
                }
        }
-       
+
        /** {@inheritDoc} */
        @Override
        protected void updateContent() {
                if(getEntity() == null){
                        setEntity(NonViralName.NewInstance(null));
                }
        /** {@inheritDoc} */
        @Override
        protected void updateContent() {
                if(getEntity() == null){
                        setEntity(NonViralName.NewInstance(null));
                }
-               
+
                super.updateContent();
                super.updateContent();
-               
+
                if(isIrrelevant()){
                        setIrrelevant(isIrrelevant());
                }else{
                if(isIrrelevant()){
                        setIrrelevant(isIrrelevant());
                }else{
@@ -129,10 +132,22 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
                        case ICZN:
                                createZoologicalNameParts(formElement, nonViralName, style);
                                break;
                        case ICZN:
                                createZoologicalNameParts(formElement, nonViralName, style);
                                break;
-                       }
+            case ICVCN:
+                //TODO implement
+                logger.warn("ICVCN not yet implemented");
+                break;
+            case ICNB:
+                //TODO implement
+                logger.warn("ICNB not yet implemented");
+                break;
+            case ICNCP:
+                //TODO implement
+                logger.warn("ICNCP not yet implemented");
+                break;
+            }
                }
        }
                }
        }
-       
+
        private void createBotanicalNameParts(ICdmFormElement formElement, NonViralName nonViralName, int style){
                BotanicalName botanicalName = (BotanicalName) nonViralName;
                checkbox_anamorphic = formFactory.createCheckbox(formElement, "Anamorphic", botanicalName.isAnamorphic(), style);
        private void createBotanicalNameParts(ICdmFormElement formElement, NonViralName nonViralName, int style){
                BotanicalName botanicalName = (BotanicalName) nonViralName;
                checkbox_anamorphic = formFactory.createCheckbox(formElement, "Anamorphic", botanicalName.isAnamorphic(), style);
@@ -144,49 +159,50 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
                text_publicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Publication Year", zoologicalName.getPublicationYear(), style);
                text_originalPublicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Orig. Publication Year", zoologicalName.getOriginalPublicationYear(), style);
        }
                text_publicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Publication Year", zoologicalName.getPublicationYear(), style);
                text_originalPublicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Orig. Publication Year", zoologicalName.getOriginalPublicationYear(), style);
        }
-       
-       private void createGenusOrUninomialControls(ICdmFormElement element, NonViralName nonViralName, int style){             
+
+       private void createGenusOrUninomialControls(ICdmFormElement element, NonViralName nonViralName, int style){
                String title = "Genus";
                Rank rank = nonViralName.getRank();
                if(rank != null && rank.isSupraGeneric()){
                String title = "Genus";
                Rank rank = nonViralName.getRank();
                if(rank != null && rank.isSupraGeneric()){
-                       title = "Uninomial";                    
+                       title = "Uninomial";
                }
                text_uninomial = formFactory.createTextWithLabelElement(element, title, nonViralName.getGenusOrUninomial(), style);
        }
                }
                text_uninomial = formFactory.createTextWithLabelElement(element, title, nonViralName.getGenusOrUninomial(), style);
        }
-       
+
        private void createInfragenerericEpithetControls(ICdmFormElement element, NonViralName nonViralName, int style){
                if(nonViralName.getRank() != null && nonViralName.getRank().isInfraGeneric() && !nonViralName.getRank().isSpeciesAggregate()){
                        text_infragenericEpithet = formFactory.createTextWithLabelElement(element, "Infrageneric Epithet", nonViralName.getInfraGenericEpithet(), style);
                }
        }
        private void createInfragenerericEpithetControls(ICdmFormElement element, NonViralName nonViralName, int style){
                if(nonViralName.getRank() != null && nonViralName.getRank().isInfraGeneric() && !nonViralName.getRank().isSpeciesAggregate()){
                        text_infragenericEpithet = formFactory.createTextWithLabelElement(element, "Infrageneric Epithet", nonViralName.getInfraGenericEpithet(), style);
                }
        }
-       
+
        private void createSpecificEpithetControls(ICdmFormElement element, NonViralName nonViralName, int style){
                if(nonViralName.getRank() != null && (nonViralName.getRank().isSpecies()  || nonViralName.getRank().isInfraSpecific() || nonViralName.getRank().isSpeciesAggregate())){
                        text_specificEpithet = formFactory.createTextWithLabelElement(element, "Specific Epithet", nonViralName.getSpecificEpithet(), SWT.NULL);
                }
        }
        private void createSpecificEpithetControls(ICdmFormElement element, NonViralName nonViralName, int style){
                if(nonViralName.getRank() != null && (nonViralName.getRank().isSpecies()  || nonViralName.getRank().isInfraSpecific() || nonViralName.getRank().isSpeciesAggregate())){
                        text_specificEpithet = formFactory.createTextWithLabelElement(element, "Specific Epithet", nonViralName.getSpecificEpithet(), SWT.NULL);
                }
        }
-       
+
        private void createInfraSpecificEpithetControls(ICdmFormElement element, NonViralName nonViralName, int style){
                if(nonViralName.getRank() != null && nonViralName.getRank().isInfraSpecific()){
                        text_infraspecificEpithet = formFactory.createTextWithLabelElement(element, "Infraspecific Epithet", nonViralName.getInfraSpecificEpithet(), SWT.NULL);
                }
        }
        private void createInfraSpecificEpithetControls(ICdmFormElement element, NonViralName nonViralName, int style){
                if(nonViralName.getRank() != null && nonViralName.getRank().isInfraSpecific()){
                        text_infraspecificEpithet = formFactory.createTextWithLabelElement(element, "Infraspecific Epithet", nonViralName.getInfraSpecificEpithet(), SWT.NULL);
                }
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource){
                if (eventSource == toggleable_cache) {
                        getEntity().setNameCache(toggleable_cache.getText(),
                                        toggleable_cache.getState());
        /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource){
                if (eventSource == toggleable_cache) {
                        getEntity().setNameCache(toggleable_cache.getText(),
                                        toggleable_cache.getState());
-                       if (!isIrrelevant())
-                               setIrrelevant(toggleable_cache.getState(),
+                       if (!isIrrelevant()) {
+                setIrrelevant(toggleable_cache.getState(),
                                                Arrays.asList(new Object[] { toggleable_cache }));
                                                Arrays.asList(new Object[] { toggleable_cache }));
+            }
                }
                else if(eventSource == combo_rank){
                        getEntity().setRank(combo_rank.getSelection());
                        clearCheckRankWarnings();
                        updateContent();
                }
                else if(eventSource == combo_rank){
                        getEntity().setRank(combo_rank.getSelection());
                        clearCheckRankWarnings();
                        updateContent();
-               }               
+               }
                else if(eventSource == text_appendedPhrase){
                        getEntity().setAppendedPhrase(text_appendedPhrase.getText());
                }
                else if(eventSource == text_appendedPhrase){
                        getEntity().setAppendedPhrase(text_appendedPhrase.getText());
                }
@@ -201,12 +217,12 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
                }
                else if(eventSource == text_uninomial){
                        getEntity().setGenusOrUninomial(text_uninomial.getText());
                }
                else if(eventSource == text_uninomial){
                        getEntity().setGenusOrUninomial(text_uninomial.getText());
-               }               
+               }
                else if(eventSource == checkbox_anamorphic){
                        ((BotanicalName)getEntity()).setAnamorphic(checkbox_anamorphic.getSelection());
                }
        }
                else if(eventSource == checkbox_anamorphic){
                        ((BotanicalName)getEntity()).setAnamorphic(checkbox_anamorphic.getSelection());
                }
        }
-               
+
        /*
         * (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.section.cdmdetail.ISelectableElement#getSelectionArbitrator()
        /*
         * (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.section.cdmdetail.ISelectableElement#getSelectionArbitrator()
@@ -216,10 +232,11 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
         *
         * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator} object.
         */
         *
         * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator} object.
         */
-       public SelectionArbitrator getSelectionArbitrator() {
+       @Override
+    public SelectionArbitrator getSelectionArbitrator() {
                return selectionArbitrator;
        }
                return selectionArbitrator;
        }
-       
+
        @Override
        public void updateToggleableCacheField() {
                if(! getEntity().isProtectedNameCache()){
        @Override
        public void updateToggleableCacheField() {
                if(! getEntity().isProtectedNameCache()){