AT: committing changes to the TaxEditor Post third round of code review
authora.theys <a.theys@localhost>
Thu, 21 Jun 2012 11:20:12 +0000 (11:20 +0000)
committera.theys <a.theys@localhost>
Thu, 21 Jun 2012 11:20:12 +0000 (11:20 +0000)
13 files changed:
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesLabelProvider.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/handler/CreateUseHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/handler/CreateUseRecordHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/handler/CreateUseSummaryHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateTaxonUseOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateUseRecordOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateUseSummaryOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java

index 23d3665d91308c2efd17219cf51204e08a11a59b..30db42aed714313840fd633d7008222a9d05882f 100644 (file)
@@ -71,7 +71,7 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
 
        protected ToggleDescriptionAction hideAllElementsAction;
 
-       private int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
+       protected int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
        
        /** {@inheritDoc} */
        @Override
index feea0619935f65f31f6911c701031f97f4c882d4..10033d118c75aeb94a41353e3a8812fe9f7c7d8a 100644 (file)
@@ -1,5 +1,5 @@
 /**\r
-* Copyright (C) 2007 EDIT\r
+* Copyright (C) 2011 EDIT\r
 * European Distributed Institute of Taxonomy \r
 * http://www.e-taxonomy.eu\r
 * \r
@@ -52,7 +52,7 @@ public class UsesLabelProvider extends ColumnLabelProvider implements
                        if (!((CategoricalData) element).getStates().isEmpty()) {\r
                                boolean isUseCategoryAbsent = true;\r
                                for (StateData statedata : ((CategoricalData) element).getStates()) {\r
-                                       if(statedata.getState() != null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()) !=null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()).getText().equals("Use Category")) {\r
+                                       if(statedata.getState() != null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()) !=null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()).getText().equals(UsageTermCollection.useCategoryVocabularyLabel)) {\r
                                                text = text + statedata.getState().getTitleCache() + ";";\r
                                                isUseCategoryAbsent = false;\r
                                        }\r
@@ -63,7 +63,7 @@ public class UsesLabelProvider extends ColumnLabelProvider implements
                                \r
                                boolean isUseSubCategoryAbsent = true;\r
                                for (StateData statedata : ((CategoricalData) element).getStates()) {\r
-                                       if(statedata.getState() != null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()) !=null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()).getText().equals("Use SubCategory")) {\r
+                                       if(statedata.getState() != null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()) !=null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()).getText().equals(UsageTermCollection.useSubCategoryVocabularyLabel)) {\r
                                                text = text + statedata.getState().getTitleCache() + ";";\r
                                                isUseSubCategoryAbsent = false;\r
                                        }\r
index 9fb18565629c7420662dcbedff6242078db8096e..f0cc2942b72e89cf8a3aef93ab3b8494fb802da1 100644 (file)
@@ -15,6 +15,8 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Tree;\r
 \r
 import eu.etaxonomy.cdm.model.common.CdmBase;\r
+import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDragListener;\r
+import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDropAdapter;\r
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementTransfer;\r
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;\r
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;\r
@@ -44,10 +46,10 @@ public class UsesViewPart extends DescriptiveViewPart implements IPartContentHas
                \r
                \r
                Transfer[] transfers = new Transfer[] { DescriptionElementTransfer.getInstance() };\r
-               /*viewer.addDragSupport(dndOperations, transfers, new DescriptionElementDragListener(\r
+               viewer.addDragSupport(dndOperations, transfers, new DescriptionElementDragListener(\r
                                this));\r
                viewer.addDropSupport(dndOperations, transfers,\r
-                               new DescriptionElementDropAdapter(viewer));*/\r
+                               new DescriptionElementDropAdapter(viewer));\r
                                                \r
                // Propagate selection from viewer\r
                getSite().setSelectionProvider(viewer);\r
index dedfdf5109e5b88802cfa24f59f486042d1801b1..f208906a8c701f15b06ff2b13f2823fceede48dd 100644 (file)
@@ -1,5 +1,5 @@
 /**\r
-* Copyright (C) 2007 EDIT\r
+* Copyright (C) 2011 EDIT\r
 * European Distributed Institute of Taxonomy \r
 * http://www.e-taxonomy.eu\r
 * \r
@@ -22,9 +22,8 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  * @version 1.0\r
  */\r
 public class CreateUseHandler extends CreateDescriptionHandler {\r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
-        */\r
+\r
+       \r
        /** {@inheritDoc} */\r
        @Override\r
        protected AbstractPostOperation createOperationInstance(String eventLabel, Taxon taxon, IPostOperationEnabled postOperationEnabled) {\r
index f596f12409d35a2623991c3244ce60d1bae409e8..8124bd3cf9ee75da63e2232e74cd0923e87faf2a 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright (C) 2007 EDIT
+ * Copyright (C) 2011 EDIT
  * European Distributed Institute of Taxonomy 
  * http://www.e-taxonomy.eu
  * 
@@ -9,8 +9,6 @@
 
 package eu.etaxonomy.taxeditor.editor.view.uses.handler;
 
-import java.util.UUID;
-
 import org.eclipse.core.commands.ExecutionEvent;
 
 import eu.etaxonomy.cdm.api.service.ITermService;
index b31d306506a22703170fb4a4a6d8f61edc070856..ebc3e2884c9346bbbc7952e9f4a27304ea079c8a 100644 (file)
@@ -1,5 +1,5 @@
 /**\r
-* Copyright (C) 2007 EDIT\r
+* Copyright (C) 2011 EDIT\r
 * European Distributed Institute of Taxonomy \r
 * http://www.e-taxonomy.eu\r
 * \r
@@ -9,8 +9,6 @@
 package eu.etaxonomy.taxeditor.editor.view.uses.handler;\r
 \r
 \r
-import java.util.UUID;\r
-\r
 import org.eclipse.core.commands.ExecutionEvent;\r
 \r
 import eu.etaxonomy.cdm.api.service.ITermService;\r
index 68f6862d0ddaa6d5f01210992b3786a6d634935c..ea45ffb28519c909ae4238eec3a69c7896b5612d 100644 (file)
@@ -1,5 +1,5 @@
 /**
-* Copyright (C) 2007 EDIT
+* Copyright (C) 2011 EDIT
 * European Distributed Institute of Taxonomy 
 * http://www.e-taxonomy.eu
 * 
@@ -32,8 +32,8 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  */
 public class CreateUseRecordOperation extends AbstractPostOperation {
        
+       /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.use."{trunked}</code> */
        public static final String ID = "eu.etaxonomy.taxeditor.editor.use.createUseRecord";
-       
        private TaxonDescription description;
        private Feature feature;
        private DescriptionElementBase element;
index 8743932584237b34a6c4b925dd1de2d0ad881f55..bd90ae37165d8a5a80b503753223d7dee54aef13 100644 (file)
@@ -1,5 +1,5 @@
 /**\r
-* Copyright (C) 2007 EDIT\r
+* Copyright (C) 2011 EDIT\r
 * European Distributed Institute of Taxonomy \r
 * http://www.e-taxonomy.eu\r
 * \r
@@ -32,7 +32,7 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
 \r
-\r
\r
 /**\r
  * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
  *\r
@@ -111,6 +111,11 @@ public class UseRecordDetailElement extends
 \r
        }\r
 \r
+       /**\r
+        * Returns the select modifier\r
+        * @param comboCategory\r
+        * @return\r
+        */\r
        private Modifier modifierSelection(String comboCategory) {\r
                if(!getEntity().getModifiers().isEmpty()) {\r
                        for (Modifier modifier : getEntity().getModifiers()) {\r
@@ -125,6 +130,11 @@ public class UseRecordDetailElement extends
                \r
        }\r
        \r
+       /**\r
+        * Returns the selected state\r
+        * @param comboCategory\r
+        * @return\r
+        */\r
        private State stateSelection(String comboCategory) {\r
                if (!getEntity().getStates().isEmpty()) {\r
                        for (StateData statedata : getEntity().getStates()) {\r
@@ -145,6 +155,12 @@ public class UseRecordDetailElement extends
                \r
        }\r
        \r
+       /**\r
+        * This function sets the combo terms (Besides EthnicGroup\r
+        * @param listOfTerms\r
+        * @param modType\r
+        * @return\r
+        */\r
        private List<Modifier> setModifierComboTerms(List<Modifier> listOfTerms, String modType) {\r
                List<Modifier> termsToAdd = new ArrayList<Modifier>();\r
                for (Modifier term : listOfTerms) {\r
@@ -161,7 +177,11 @@ public class UseRecordDetailElement extends
        }\r
        \r
 \r
-\r
+       /**\r
+        * This function sets the Use Category combo term\r
+        * @param listOfTerms\r
+        * @return\r
+        */\r
        private List<State> setUseCategoryComboTerms(List<State> listOfTerms) {\r
                List<State> termsToAdd = new ArrayList<State>();\r
                for (State term : listOfTerms) {\r
@@ -177,6 +197,12 @@ public class UseRecordDetailElement extends
 \r
        }\r
 \r
+       /**\r
+        * This function sets the Use SubCategory combo term\r
+        * @param listOfTerms\r
+        * @param selectedUseCategory\r
+        * @return\r
+        */\r
        private List<State> setUseCategoryComboTerms(List<State> listOfTerms,\r
                        State selectedUseCategory) {\r
                List<State> termsToAdd = new ArrayList<State>();\r
@@ -217,6 +243,13 @@ public class UseRecordDetailElement extends
                return termsToAdd;\r
        }\r
        \r
+       \r
+       /**\r
+        * This function sets the EthnicGroup combo term\r
+        * @param listOfTerms\r
+        * @param selectedHumangroup\r
+        * @return\r
+        */\r
        private List<Modifier> setEthnicGroupComboTerms(List<Modifier> listOfTerms,\r
                        Modifier selectedHumangroup) {\r
                List<Modifier> termsToAdd = new ArrayList<Modifier>();\r
@@ -255,6 +288,7 @@ public class UseRecordDetailElement extends
                return termsToAdd;\r
        }\r
 \r
+       \r
        /** {@inheritDoc} */\r
        @Override\r
        public void handleEvent(Object eventSource) {\r
@@ -496,6 +530,12 @@ public class UseRecordDetailElement extends
        \r
        \r
 \r
+       /**\r
+        * This function Checks the vocabulary type\r
+        * @param term\r
+        * @param vocabularyExpected\r
+        * @return\r
+        */\r
        private boolean GetVocabularyType(Modifier term, String vocabularyExpected) {\r
                if ((term.getPartOf() != null)  && (term.getPartOf().getTitleCache().equals(vocabularyExpected))) {\r
                        return true;\r
@@ -517,6 +557,7 @@ public class UseRecordDetailElement extends
                super.setEntity(entity);\r
        }\r
 \r
+       /** {@inheritDoc} */\r
        @Override\r
        public void widgetSelected(SelectionEvent e) {\r
                Object eventSource = e.getSource();\r
@@ -562,6 +603,7 @@ public class UseRecordDetailElement extends
                }\r
        }\r
 \r
+       /** {@inheritDoc} */\r
        @Override\r
        public void widgetDefaultSelected(SelectionEvent e) {\r
                // TODO Auto-generated method stub\r
index 8231d4d2a65488338bca7a2bd619a9b5a0cde5a1..f4c2c58051ebf20cfed6d2ea370d3939f8cabd2f 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 /**
- * Copyright (C) 2007 EDIT
+ * Copyright (C) 2011 EDIT
  * European Distributed Institute of Taxonomy 
  * http://www.e-taxonomy.eu
  * 
@@ -310,6 +310,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                fireSelectionChanged(selectionChangedEvent);
        }
 
+       /**
+        * createTaxonSections(RootElement parent)
+        * @param parent
+        */
        private void createTaxonSections(RootElement parent) {
                destroySections();
 
@@ -371,6 +375,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                addPart(parsingMessagesSection);
        }
 
+       /**
+        * createNameSections
+        * @param parent
+        */
        private void createNameSections(RootElement parent) {
                destroySections();
                NonViralNameDetailSection nonViralNameSection = (NonViralNameDetailSection) formFactory
@@ -419,6 +427,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                addPart(nameRelationshipSection);
        }
 
+       /**
+        * createReferenceSections
+        * @param parent
+        */
        private void createReferenceSections(RootElement parent) {
                destroySections();
 
@@ -430,6 +442,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                addPart(referenceDetailSection);
        }
 
+       /**
+        * createTeamOrPersonBaseDetailSection
+        * @param parent
+        */
        private void createTeamOrPersonBaseDetailSection(RootElement parent) {
                destroySections();
                TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = (TeamOrPersonBaseDetailSection) formFactory
@@ -440,6 +456,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                addPart(teamOrPersonBaseDetailSection);
        }
 
+       /**
+        * createTeamDetailSection
+        * @param parent
+        */
        private void createTeamDetailSection(RootElement parent) {
                destroySections();
                TeamDetailSection teamDetailSection = (TeamDetailSection) formFactory
@@ -449,7 +469,11 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
                addPart(teamDetailSection);
        }
-
+       
+       /**
+        * createPersonDetailSection
+        * @param parent
+        */
        private void createPersonDetailSection(RootElement parent) {
                destroySections();
                PersonDetailSection personDetailSection = (PersonDetailSection) formFactory
@@ -459,6 +483,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                addPart(personDetailSection);
        }
 
+       /**
+        * createDescriptionElementSection
+        * @param parent
+        */
        private void createDescriptionElementSection(RootElement parent) {
                destroySections();
 
@@ -488,6 +516,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                addPart(descriptionElementMediaSection);
        }
 
+       /**
+        * createDescriptionSection
+        * @param parent
+        */
        private void createDescriptionSection(RootElement parent) {
                destroySections();
                DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
@@ -567,6 +599,11 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
                addPart(descriptionDetailSection);
        }
+       
+       /**
+        * createMediaElementSection
+        * @param parent
+        */
 
        private void createMediaElementSection(RootElement parent) {
                destroySections();
@@ -578,6 +615,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                addPart(mediaDetailSection);
        }
 
+       /**
+        * createDerivedUnitBaseElementSection
+        * @param parent
+        */
        private void createDerivedUnitBaseElementSection(RootElement parent) {
                destroySections();
 
@@ -664,6 +705,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                addPart(taxonomicScopeSection);
        }
 
+       /**
+        * createPolytomousKeyNodeSection
+        * @param parent
+        */
        private void createPolytomousKeyNodeSection(RootElement parent) {
                destroySections();
 
@@ -694,6 +739,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                
        }
 
+       /**
+        * createUserSection
+        * @param parent
+        */
        private void createUserSection(RootElement parent) {
                destroySections();
 
@@ -711,6 +760,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                addPart(groupByUserDetailSection);
        }
 
+       /**
+        * createTaxonRelationshipSection
+        * @param parent
+        */
        private void createTaxonRelationshipSection(RootElement parent) {
                destroySections();
 
@@ -740,6 +793,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                addPart(termVocabularyDetailSection);
        }
 
+       /**
+        * createDefinedTermSection
+        * @param parent
+        */
        private void createDefinedTermSection(RootElement parent) {
                destroySections();