ScopeRestrictionSection : creating new DefinedTerm with TermType:Scope
authorCherian Mathew <c.mathew@bgbm.org>
Thu, 18 Jul 2013 16:26:45 +0000 (16:26 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Thu, 18 Jul 2013 16:26:45 +0000 (16:26 +0000)
DetailsViewer : removed (for the moment commented out) DescriptionSourceSection since this is already in the supplemental details viewer
DefinedTermMenuFactory : code clean up

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenuFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/ScopeRestrictionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java

index ddcbb93d3b4fe8a6bdf682bf047fea75b7320075..b3e02f9701f452ce15c0cf7a87d2a63f7743ebe4 100644 (file)
@@ -53,10 +53,8 @@ public class DefinedTermMenuFactory extends ExtensionContributionFactory {
                // if term type has a parent, do not add it
                // it will be added in the recursive call
                if(tt.getKindOf() == null) {
-                       IContributionItem ici = addChildTermsToMenuManager(tt, serviceLocator);
-                       
-                       if(ici != null) {
-                               System.out.println("Adding : " + tt.getMessage());                              
+                       IContributionItem ici = addChildTermsToMenuManager(tt, serviceLocator);                 
+                       if(ici != null) {                                                       
                                dtMenuManager.add(ici);
                        }
                }
@@ -67,22 +65,18 @@ public class DefinedTermMenuFactory extends ExtensionContributionFactory {
        
                Set<TermType> children = termType.getGeneralizationOf();
                // term type has no children, so create menu item
-               if(children.isEmpty()) {
-                       System.out.println("No children for : " + termType.getMessage());
+               if(children.isEmpty()) {                        
                        return createMenuItem(termType, serviceLocator);
                }
-               // term type has children, so create sub menu
-               System.out.println("Children for : " + termType.getMessage());
+               // term type has children, so create sub menu           
                MenuManager dtMenuManager = 
                                new MenuManager(termType.getMessage(),"eu.etaxonomy.taxeditor.store." + termType.getKey() + "Menu"); 
                dtMenuManager.setVisible(true);
                dtMenuManager.add(createDefaultMenuItem(termType, serviceLocator));
                // add child items to the sub menu
-               for(TermType tt : children) {
-                       System.out.println("Child : " + tt.getMessage());
+               for(TermType tt : children) {                   
                        IContributionItem item = addChildTermsToMenuManager(tt,serviceLocator);
-                       if(item != null) {
-                               System.out.println("Adding : " + tt.getMessage() + " to "  + termType.getMessage());
+                       if(item != null) {                              
                                dtMenuManager.add(item);
                        }                                       
                }               
@@ -94,8 +88,7 @@ public class DefinedTermMenuFactory extends ExtensionContributionFactory {
                
                Map<String, String> params = new HashMap<String, String>();
                params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
-                               termType.getUuid().toString());
-               System.out.println("Term Type UUID : " + termType.getUuid().toString());
+                               termType.getUuid().toString());         
                
         CommandContributionItemParameter p = new CommandContributionItemParameter(
                 serviceLocator, 
@@ -121,8 +114,7 @@ public class DefinedTermMenuFactory extends ExtensionContributionFactory {
                
                Map<String, String> params = new HashMap<String, String>();
                params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
-                               termType.getUuid().toString());
-               System.out.println("Term Type UUID : " + termType.getUuid().toString());
+                               termType.getUuid().toString());         
                
         CommandContributionItemParameter p = new CommandContributionItemParameter(
                 serviceLocator, 
index b0517d16e83c874746468faec9a58f3fca033c46..5a39287c54544222d7e2f9d333b33018429dbd2d 100644 (file)
@@ -7,6 +7,7 @@ import java.util.Collection;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -29,8 +30,9 @@ public class ScopeRestrictionSection extends AbstractEntityCollectionSection<Pol
        }
 
        @Override
-       public DefinedTerm createNewElement() {
-               return DefinedTerm.NewInstance();
+       public DefinedTerm createNewElement() {         
+               return DefinedTerm.NewInstance(TermType.Scope);
+                       
        }
 
        @Override
index 074becff972a9656c5d053316056491ed0e390d2..2a13d51ae15483d2feae1bd85f610ff7770d8621 100644 (file)
@@ -547,11 +547,11 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-               DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+//             DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
+//                             .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
+//                                             getConversationHolder(), parent, Section.TWISTIE);
+//
+//             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
                ScopeSection scopeSection = (ScopeSection) formFactory
                                .createEntityDetailSection(EntityDetailType.SCOPE,
@@ -562,7 +562,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                addPart(descriptionDetailSection);
                addPart(naturalLanguageSection);
                addPart(describedSpecimenSection);
-               addPart(descriptionSourceSection);
+//             addPart(descriptionSourceSection);
                addPart(scopeSection);
        }