AT: committing latest changes to the Tax Editor after a first round of Code review
authora.theys <a.theys@localhost>
Wed, 14 Mar 2012 14:22:11 +0000 (14:22 +0000)
committera.theys <a.theys@localhost>
Wed, 14 Mar 2012 14:22:11 +0000 (14:22 +0000)
15 files changed:
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/PalmUses.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesContentProvider.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/DeleteUseHandler.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/DeleteTaxonUseOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/DeleteUseRecordOperation.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/userecords/UseRecordsViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/userecords/UseRecordsViewer.java

index 735c403d5802461faa9485bbcd260143491e16ce..9d77f7f40386abf6abdd274d3bbf289f7c794379 100644 (file)
@@ -12,8 +12,11 @@ import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
 import eu.etaxonomy.taxeditor.view.userecords.UseRecordsViewPart;\r
 \r
 /**\r
- * @author a.theys\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
  *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
  */\r
 public class PalmUses extends Default {\r
 \r
@@ -26,8 +29,6 @@ public class PalmUses extends Default {
                layout.addView(UseRecordsViewPart.ID, IPageLayout.RIGHT, 0.25f, layout.getEditorArea());\r
                layout.addView(UsesViewPart.ID, IPageLayout.BOTTOM, 0.25f, layout.getEditorArea());\r
                \r
-               // layout.addView(SupplementalDataViewPart.ID, IPageLayout.BOTTOM, 0.25f, DetailsViewPart.ID);\r
-               \r
                createAdditionalFolder(layout, layout.getEditorArea());\r
        }\r
        \r
index b1052f61c1397449f66ad62b83000aeae9e956fe..98cb3a6834559f77acb3366050c91047c56b85c3 100644 (file)
@@ -10,7 +10,7 @@ import java.util.UUID;
 import org.eclipse.jface.viewers.ITreeContentProvider;\r
 import org.eclipse.jface.viewers.Viewer;\r
 \r
-import eu.etaxonomy.cdm.api.service.IDescriptionService;\r
+import eu.etaxonomy.cdm.api.service.ITermService;\r
 import eu.etaxonomy.cdm.model.common.Marker;\r
 import eu.etaxonomy.cdm.model.common.MarkerType;\r
 import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
@@ -25,6 +25,13 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 import eu.etaxonomy.taxeditor.store.TermStore;\r
 \r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
 public class UsesContentProvider implements ITreeContentProvider {\r
 \r
        private static final Object[] NO_CHILDREN = new Object[0];\r
@@ -124,29 +131,19 @@ public class UsesContentProvider implements ITreeContentProvider {
         * @param parentElement\r
         * @return\r
         */\r
-       //CdmStore.getService(IDescriptionService.class).listTaxonDescriptions(input.getTaxonNode().getTaxon(), null, null, null, null, null, null)\r
        private List<DescriptionBase> getDescriptions(TaxonEditorInput parentElement) {\r
-               //this.markerTypes.addAll(CdmStore.getTermManager().getPreferredMarkerTypes());\r
                this.markerTypes.addAll(CdmStore.getTermManager().getPreferredTerms(MarkerType.class));\r
                Taxon taxon = parentElement.getTaxon();\r
-               Set<MarkerType> typesToDisdplay = new HashSet<MarkerType>();\r
                List<DescriptionBase> descriptions = new ArrayList<DescriptionBase>();\r
-               List<TaxonDescription> usesDescriptions = new ArrayList<TaxonDescription>();\r
                \r
-               /*for (MarkerType markerType : markerTypes) {\r
-                       if (markerType.toString().equals("complete")) {\r
-                               typesToDisdplay.add(markerType);\r
-                       }\r
-               }*/\r
-               //usesDescriptions = CdmStore.getService(IDescriptionService.class).listTaxonDescriptions(taxon, null, null, typesToDisdplay, null, null, null);\r
-               //for(DescriptionBase description : CdmStore.getService(IDescriptionService.class).listTaxonDescriptions(taxon, null, null, typesToDisdplay, null, null, null)){\r
-               for(DescriptionBase description : taxon.getDescriptions()){\r
+       for(DescriptionBase description : taxon.getDescriptions()){\r
                        if(! description.isImageGallery()){\r
+                               MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039"));\r
                                Set<Marker> descriptionMarkers = description.getMarkers();\r
                                if(descriptionMarkers != null) {\r
                                        for (Marker marker: descriptionMarkers) {\r
                                                //TODO Use the GetbyUUID method\r
-                                               if(marker.getMarkerType().getTitleCache().equals("use")) {\r
+                                               if(marker.getMarkerType().equals(useMarkertype)) {\r
                                                        descriptions.add(description);\r
                                                }\r
                                        }\r
index 85601542a46112d7b855eaf83f4e0edc12d5bca1..8b41d9dfba0a177ad0d6f48001218e789d4ee37a 100644 (file)
@@ -1,10 +1,6 @@
 package eu.etaxonomy.taxeditor.editor.view.uses;\r
 \r
-import java.util.Arrays;\r
-import java.util.List;\r
-import java.util.Map;\r
 \r
-import javax.swing.text.html.HTMLDocument.HTMLReader.IsindexAction;\r
 \r
 import org.eclipse.jface.viewers.ColumnLabelProvider;\r
 import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;\r
@@ -12,30 +8,25 @@ import org.eclipse.jface.viewers.StyledString;
 \r
 import eu.etaxonomy.cdm.api.service.DefaultCategoricalDescriptionBuilder;\r
 import eu.etaxonomy.cdm.api.service.DescriptionBuilder;\r
-import eu.etaxonomy.cdm.model.common.Language;\r
-import eu.etaxonomy.cdm.model.common.LanguageString;\r
 import eu.etaxonomy.cdm.model.description.CategoricalData;\r
 import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
-import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
 import eu.etaxonomy.cdm.model.description.Modifier;\r
-import eu.etaxonomy.cdm.model.description.State;\r
 import eu.etaxonomy.cdm.model.description.StateData;\r
-import eu.etaxonomy.cdm.model.description.TextData;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
 public class UsesLabelProvider extends ColumnLabelProvider implements\r
                IStyledLabelProvider {\r
        \r
-       private static DescriptionBuilder<CategoricalData> categoricalDescriptionBuilder = new DefaultCategoricalDescriptionBuilder();\r
        public String getText(Object element) {\r
                String text = "";\r
-               /*\r
-                * return DescriptionHelper.getLabel(element);\r
-                * \r
-                * for (Marker marker : element.getMarkers()) { if\r
-                * (marker.getMarkerType().getTitleCache().equals("use")) { return\r
-                * "Use: " + text; } }\r
-                */\r
+\r
                if (element instanceof DescriptionBase) {\r
                        text = ((DescriptionBase) element).getTitleCache();\r
                        if (text == null || text.length() == 0) {\r
@@ -46,8 +37,6 @@ public class UsesLabelProvider extends ColumnLabelProvider implements
                        }\r
                }\r
                else if (element instanceof CategoricalData) {\r
-                       //String text = "";\r
-                       //TextData textData = categoricalDescriptionBuilder.build((CategoricalData) element, getLanguageList());\r
                        if (!((CategoricalData) element).getStates().isEmpty()) {\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
@@ -126,8 +115,6 @@ public class UsesLabelProvider extends ColumnLabelProvider implements
                                StyledString.QUALIFIER_STYLER);\r
        }\r
        \r
-       private static List<Language> getLanguageList(){\r
-               return Arrays.asList(new Language[]{CdmStore.getDefaultLanguage()});\r
-       }\r
+       \r
 \r
 }\r
index 1f9cf8653e618ed4c106f9aa8a1bbadb090321ee..94ffa1c1a7b2c43b5adc86588e00246d75802bb4 100644 (file)
@@ -75,7 +75,13 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;\r
 \r
 \r
-\r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
 public class UsesViewPart extends AbstractCdmEditorViewPart implements IPartContentHasDetails, IPartContentHasSupplementalData {\r
        \r
        \r
@@ -110,23 +116,12 @@ public class UsesViewPart extends AbstractCdmEditorViewPart implements IPartCont
                        TermVocabulary<Modifier> humanGroupVocabulary =  (TermVocabulary<Modifier>) CdmStore.getService(IVocabularyService.class).find(UUID.fromString("ca46cea5-bdf7-438d-9cd8-e2793d2178dc"));\r
                        ConversationHolder conversation = CdmStore.createConversation();\r
                        if (existingMarkertype == null) {\r
-                               //existingMarkertype.set("use")\r
-                               //existingMarkertype.setLabel("use");\r
-                               //MarkerType useMarkerType = MarkerType.NewInstance("use", "use", null);\r
-                               //ConversationHolder conversation = CdmStore.createConversation();\r
                                existingMarkertype = MarkerType.NewInstance("use", "use", null);\r
                                existingMarkertype.setUuid( UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039"));\r
-                               //CdmStore.getService(ITermService.class).save(existingMarkertype);\r
-                               //saveOrUpdate(existingMarkertype);\r
-                               //TermVocabulary<MarkerType> markerTypeVocabulary = (TermVocabulary<MarkerType>)CdmStore.getService(IVocabularyService.class).getVocabulary(VocabularyEnum.MarkerType);\r
                                TermVocabulary<MarkerType> markerTypeVocabulary = (TermVocabulary<MarkerType>)CdmStore.getService(IVocabularyService.class).find((UUID.fromString("19dffff7-e142-429c-a420-5d28e4ebe305")));\r
-                               //(UUID.fromString("19dffff7-e142-429c-a420-5d28e4ebe305"));\r
-                               //CdmStore.\r
-                       \r
                                markerTypeVocabulary.addTerm(existingMarkertype);\r
                                CdmStore.getService(IVocabularyService.class).saveOrUpdate(markerTypeVocabulary);\r
                                conversation.commit(true);\r
-                               //conversation.close();\r
                        }\r
                        if (stateVocabulary == null) {\r
                                monitor.subTask("stateVocabulary empty");\r
@@ -134,7 +129,6 @@ public class UsesViewPart extends AbstractCdmEditorViewPart implements IPartCont
                                try {\r
                                        termSourceUri = new URI("eu.etaxonomy.cdm.model.description.State");\r
                                } catch (URISyntaxException e) {\r
-                                       // TODO Auto-generated catch block\r
                                        e.printStackTrace();\r
                                }\r
                                stateVocabulary = TermVocabulary.NewInstance("Use Category", "Use Category", null, termSourceUri);\r
@@ -152,7 +146,6 @@ public class UsesViewPart extends AbstractCdmEditorViewPart implements IPartCont
                                try {\r
                                        termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier");\r
                                } catch (URISyntaxException e) {\r
-                                       // TODO Auto-generated catch block\r
                                        e.printStackTrace();\r
                                }\r
                                countryVocabulary = TermVocabulary.NewInstance("Country", "Country", null, termSourceUri);\r
@@ -169,7 +162,6 @@ public class UsesViewPart extends AbstractCdmEditorViewPart implements IPartCont
                                try {\r
                                        termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier");\r
                                } catch (URISyntaxException e) {\r
-                                       // TODO Auto-generated catch block\r
                                        e.printStackTrace();\r
                                }\r
                                plantPartVocabulary = TermVocabulary.NewInstance("Plant Part", "Plant Part", null, termSourceUri);\r
@@ -185,7 +177,6 @@ public class UsesViewPart extends AbstractCdmEditorViewPart implements IPartCont
                                try {\r
                                        termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier");\r
                                } catch (URISyntaxException e) {\r
-                                       // TODO Auto-generated catch block\r
                                        e.printStackTrace();\r
                                }\r
                                humanGroupVocabulary = TermVocabulary.NewInstance("Human Group", "Human Group", null, termSourceUri);\r
@@ -198,13 +189,9 @@ public class UsesViewPart extends AbstractCdmEditorViewPart implements IPartCont
                                conversation.commit(true);\r
                        }\r
                        if(featureUseRecord == null) {\r
-                               //Feature usesFeature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("e5374d39-b210-47c7-bec1-bee05b5f1cb6"));\r
                                featureUseRecord = Feature.NewInstance("Use Record", "Use Record", null);\r
                                featureUseRecord.setUuid(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599"));\r
                                featureUseRecord.setSupportsCategoricalData(true);\r
-                               //featureUseRecord\r
-                               //featureUseRecord.setLabel("Use Record");\r
-                               //featureUseRecord.\r
                                TermVocabulary<Feature> featureVocabulary = (TermVocabulary<Feature>)CdmStore.getService(IVocabularyService.class).find((UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8")));\r
                                featureVocabulary.addTerm(featureUseRecord);\r
                                CdmStore.getService(IVocabularyService.class).saveOrUpdate(featureVocabulary);\r
@@ -215,10 +202,6 @@ public class UsesViewPart extends AbstractCdmEditorViewPart implements IPartCont
                        \r
                        conversation.close();   \r
                }\r
-               /*public void contextStop(IMemento memento, IProgressMonitor monitor) {\r
-                       monitor.subTask("Getting rid of search results");\r
-                       NavigationUtil.hideView(SearchResultView.this);\r
-               }*/\r
        }\r
        \r
        public static final String ID = "eu.etaxonomy.taxeditor.editor.view.uses";\r
index e9a71d5398f203af37cddd7ef5d6e8b5c8d987f7..42b9650723ca51e430fece9a00749651d420dba5 100644 (file)
@@ -17,6 +17,13 @@ import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateTaxonUseOperation
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 \r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
 public class CreateUseHandler extends AbstractHandler {\r
        /* (non-Javadoc)\r
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
@@ -36,7 +43,6 @@ public class CreateUseHandler extends AbstractHandler {
                        Taxon taxon = ((TaxonEditorInput) input).getTaxon();    \r
                        AbstractPostOperation operation;\r
                        try {\r
-                               // TODO use undo context specific to editor\r
                                operation = new CreateTaxonUseOperation(event.getCommand().getName(), \r
                                                EditorUtil.getUndoContext(), taxon, postOperationEnabled);\r
                                EditorUtil.executeOperation(operation);\r
index cc679a5cc54a2a9ad263898a9e91a3fb7084af83..5f4c39538f4e39d4b9a18dd608baf747933074e0 100644 (file)
@@ -1,7 +1,6 @@
 package eu.etaxonomy.taxeditor.editor.view.uses.handler;
 
-import java.util.List;
-import java.util.Set;
+
 import java.util.UUID;
 
 import org.eclipse.core.commands.AbstractHandler;
@@ -12,7 +11,6 @@ import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.ITreeSelection;
 import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.widgets.Event;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPart;
@@ -20,12 +18,8 @@ import org.eclipse.ui.forms.editor.FormEditor;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.api.service.ITermService;
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.description.CategoricalData;
-import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
-import eu.etaxonomy.cdm.model.description.TextData;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
@@ -34,6 +28,13 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
+/**
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.
+ *
+ * @author a.theys     
+ * @created mar 13, 2012
+ * @version 1.0
+ */
 public class CreateUseRecordHandler extends AbstractHandler {
        public Object execute(ExecutionEvent event) throws ExecutionException {
                IWorkbenchPart part = HandlerUtil.getActivePart(event);
@@ -69,10 +70,9 @@ public class CreateUseRecordHandler extends AbstractHandler {
                                AbstractPostOperation operation = null;
                                try {
                                        //Use Record Feature retrieval below
-                                       //Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599"));
-                                       //Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("247606f2-5f24-421f-92ca-dad2351b171e"));
+                                       Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599"));
                                        //The code below retrieves the feature "Uses" as a work around
-                                       Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("e5374d39-b210-47c7-bec1-bee05b5f1cb6"));
+                                       //Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("e5374d39-b210-47c7-bec1-bee05b5f1cb6"));
                                        feature.setSupportsCategoricalData(true);
                                        operation = new CreateUseRecordOperation(event
                                                        .getCommand().getName(),
index 0028fc3a1735b136b2b9b172c3dd58d9eae5c86c..43a39ce5547a095755b8d2147736dbffd34670e5 100644 (file)
@@ -9,23 +9,25 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.common.NotDefinedException;\r
 import org.eclipse.core.commands.operations.IUndoContext;\r
 import org.eclipse.jface.viewers.IStructuredSelection;\r
-import org.eclipse.jface.viewers.TreePath;\r
-import org.eclipse.jface.viewers.TreeSelection;\r
 import org.eclipse.ui.IWorkbenchPart;\r
 import org.eclipse.ui.handlers.HandlerUtil;\r
 \r
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
 import eu.etaxonomy.cdm.model.description.TaxonDescription;\r
-import eu.etaxonomy.cdm.model.media.Media;\r
 import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
-import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.DeleteDescriptionElementOperation;\r
-import eu.etaxonomy.taxeditor.editor.view.media.operation.DeleteMediaOperation;\r
 import eu.etaxonomy.taxeditor.editor.view.uses.operation.DeleteTaxonUseOperation;\r
 import eu.etaxonomy.taxeditor.editor.view.uses.operation.DeleteUseRecordOperation;\r
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 \r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
 public class DeleteUseHandler extends AbstractHandler {\r
 \r
        /*\r
@@ -53,8 +55,6 @@ public class DeleteUseHandler extends AbstractHandler {
 \r
                        for (Object object : selection.toArray()) {\r
 \r
-                               AbstractPostOperation operation = null;\r
-\r
                                // TaxonDescription\r
                                if (object instanceof TaxonDescription) {\r
                                        operations.add(new DeleteTaxonUseOperation(label,\r
@@ -76,20 +76,7 @@ public class DeleteUseHandler extends AbstractHandler {
                                                                postOperationEnabled));\r
                                        }\r
                                }\r
-                               // Media\r
-                               else if (object instanceof Media) {\r
-                                       TreeSelection treeSelection = (TreeSelection) selection;\r
-\r
-                                       TreePath[] path = treeSelection.getPathsFor(object);\r
-\r
-                                       TaxonDescription imageGallery = (TaxonDescription) path[0]\r
-                                                       .getFirstSegment();\r
-\r
-                                       operations\r
-                                                       .add(new DeleteMediaOperation(label, undoContext,\r
-                                                                       imageGallery, (Media) object,\r
-                                                                       postOperationEnabled));\r
-                               } else {\r
+                               else {\r
                                        EditorUtil.error(getClass(),\r
                                                        "Selection is not valid for this delete handler",\r
                                                        null);\r
index b8ca26e8e8ebd7a92a7409eb6d65c63721ff3f8e..d133d6a89ad94634ed665e265321e86408c4c582 100644 (file)
@@ -20,6 +20,13 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
 public class CreateTaxonUseOperation extends AbstractPostOperation {\r
        private TaxonDescription description;\r
        private boolean isImageGallery;\r
@@ -66,7 +73,6 @@ public class CreateTaxonUseOperation extends AbstractPostOperation {
                monitor.worked(20);\r
                //this.markerTypes.addAll(CdmStore.getTermManager().getPreferredMarkerTypes());\r
                this.markerTypes.addAll(CdmStore.getTermManager().getPreferredTerms(MarkerType.class));\r
-               Set<MarkerType> typesToDisdplay = new HashSet<MarkerType>();\r
                for (MarkerType markerType : markerTypes) {\r
                        if (markerType.getTitleCache().equals("use")) {\r
                                marker = Marker.NewInstance(markerType, true);\r
index 90fd7e60422ef790c7ec2f200c854a3d2d1004a5..e001a28aa6d4a6dad98944df394f7e0fcccb59ca 100644 (file)
@@ -20,6 +20,14 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
+
+/**
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.
+ *
+ * @author a.theys     
+ * @created mar 13, 2012
+ * @version 1.0
+ */
 public class CreateUseRecordOperation extends AbstractPostOperation {
        
        public static final String ID = "eu.etaxonomy.taxeditor.editor.use.createUseRecord";
@@ -29,8 +37,6 @@ public class CreateUseRecordOperation extends AbstractPostOperation {
        private DescriptionElementBase element;
 
        
-       /*public CreateUseRecordOperation(String label, IUndoContext undoContext,
-                       Taxon taxon, TaxonDescription description, Feature feature, IPostOperationEnabled postOperationEnabled) {*/
        public CreateUseRecordOperation(String label, IUndoContext undoContext,
                Taxon taxon, TaxonDescription description, Feature feature, IPostOperationEnabled postOperationEnabled) {
                        super(label, undoContext, taxon, postOperationEnabled);
@@ -43,14 +49,8 @@ public class CreateUseRecordOperation extends AbstractPostOperation {
                        IUndoContext undoContext, Taxon taxon,
                        TaxonDescription description, Feature feature,
                        DescriptionElementBase element, IPostOperationEnabled postOperationEnabled) {
-                       /*public CreateUseRecordOperation(String label,
-                                       IUndoContext undoContext, Taxon taxon,
-                                       TaxonDescription description, Feature feature,
-                                       DescriptionElementBase element, IPostOperationEnabled postOperationEnabled) {*/
+                       this(label, undoContext, taxon, description, feature, postOperationEnabled);
                        
-                               this(label, undoContext, taxon, description, feature, postOperationEnabled);
-                               //this(label, undoContext, taxon, description, (CategoricalData) element, postOperationEnabled);
-               
                this.element = element;
        }
 
index 66a5073f20ef85e81cb77b6773d3e4e1d2724601..a98b9347a0e42a34704a016c29dd2a3dca4cb6f7 100644 (file)
@@ -10,6 +10,14 @@ import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 \r
+\r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
 public class DeleteTaxonUseOperation extends AbstractPostOperation {\r
                \r
                private TaxonDescription description;\r
index b50e4bd650bc68f5a57ef26e154e6070d481fea4..8b27e6bd9eabc5d4835223728eab013fa1eb2ed5 100644 (file)
@@ -1,5 +1,6 @@
 package eu.etaxonomy.taxeditor.editor.view.uses.operation;\r
 \r
+\r
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.core.commands.operations.IUndoContext;\r
 import org.eclipse.core.runtime.IAdaptable;\r
@@ -12,6 +13,13 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
 \r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
 public class DeleteUseRecordOperation extends AbstractPostOperation {\r
        private DescriptionElementBase element;\r
        private DescriptionBase description = null;\r
index 56a66d8644ea7acd3195705bd8ec640c1e019877..d858d28404a12f708cc535ab9fd681c6c75a6df4 100644 (file)
@@ -22,8 +22,15 @@ import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
-import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailElement;\r
 \r
+\r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
 public class UseRecordDetailElement extends\r
                AbstractCdmDetailElement<CategoricalData> implements SelectionListener {\r
 \r
@@ -242,11 +249,6 @@ public class UseRecordDetailElement extends
        /** {@inheritDoc} */\r
        @Override\r
        public void handleEvent(Object eventSource) {\r
-               /*\r
-                * if(eventSource == checkbox_orderRelevant){\r
-                * getEntity().setOrderRelevant(checkbox_orderRelevant.getSelection());\r
-                * }\r
-                */\r
                if (eventSource == combo_UseCategory) {\r
                        if (combo_UseCategory.getSelection() != null) {\r
                                boolean isChanged = false;\r
@@ -512,7 +514,6 @@ public class UseRecordDetailElement extends
                for (Object object: combo_UseCategory.getControls()) {\r
                        if (object == eventSource) {\r
                                State selectedUseCategory = combo_UseCategory.getSelection();\r
-                               //List<State> newSubCategories = setUseCategoryComboTerms(TermStore.getTerms(State.class, null, false),selectedUseCategory);\r
                                if (selectedUseCategory != null) {\r
                                        combo_UseSubCategory.setTerms(setUseCategoryComboTerms(TermStore.getTerms(State.class, null, false),selectedUseCategory));\r
                                \r
index 31891b7e7380e2b887c0aeeb1595e2774174cbb7..2af0297fc94f731cf85c765a7fa9398f29c5357a 100644 (file)
@@ -10,6 +10,13 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
 \r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
 public class UseRecordDetailSection extends AbstractCdmDetailSection<DescriptionElementBase> {\r
        public UseRecordDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,\r
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {\r
index c87beb8f74f744d9efa083fa14781c4fc164257b..d8f3ca946704371c31b09cc6d33ab1992df76aca 100644 (file)
@@ -14,85 +14,89 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;\r
 import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;\r
 \r
-\r
-       public class UseRecordsViewPart extends AbstractCdmEditorViewPart implements IPartContentHasSupplementalData{\r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
+public class UseRecordsViewPart extends AbstractCdmEditorViewPart implements IPartContentHasSupplementalData{\r
                \r
-               public static String ID = "eu.etaxonomy.taxeditor.view.userecords";\r
-               private UseRecordsViewer viewer;\r
+       public static String ID = "eu.etaxonomy.taxeditor.view.userecords";\r
+       private UseRecordsViewer viewer;\r
+       \r
+       @Override\r
+       public void createViewer(Composite parent) {\r
+               viewer = new UseRecordsViewer(parent, this);\r
+               getSite().setSelectionProvider(viewer);\r
                \r
-               @Override\r
-               public void createViewer(Composite parent) {\r
-                       //selectionService.addPostSelectionListener(this);\r
-                       \r
-                       viewer = new UseRecordsViewer(parent, this);\r
-                       getSite().setSelectionProvider(viewer);\r
-                       \r
+       }\r
+       \r
+       @Override\r
+       public void selectionChanged(IWorkbenchPart part, ISelection selection) {\r
+               if(StoreUtil.getActiveEditor() == null){\r
+                       showEmptyPage();\r
+                       return;\r
+               }\r
+               \r
+               if(part == this){\r
+                       return;\r
                }\r
                \r
-               @Override\r
-               public void selectionChanged(IWorkbenchPart part, ISelection selection) {\r
-                       if(StoreUtil.getActiveEditor() == null){\r
+               if(!(selection instanceof IStructuredSelection)){\r
+                       return;\r
+               }\r
+               \r
+               IStructuredSelection structuredSelection = (IStructuredSelection) selection;\r
+               \r
+               if((part instanceof IEditorPart) || (part instanceof AbstractCdmViewPart)) {\r
+                       if(structuredSelection.size() != 1){\r
                                showEmptyPage();\r
                                return;\r
                        }\r
                        \r
-                       if(part == this){\r
-                               return;\r
-                       }\r
-                       \r
-                       if(!(selection instanceof IStructuredSelection)){\r
-                               return;\r
-                       }\r
-                       \r
-                       IStructuredSelection structuredSelection = (IStructuredSelection) selection;\r
-                       \r
-                       if((part instanceof IEditorPart) || (part instanceof AbstractCdmViewPart)) {\r
-                               if(structuredSelection.size() != 1){\r
+                       // do not show details for feature nodes TODO really? \r
+                       if(structuredSelection.getFirstElement() instanceof FeatureNodeContainer){\r
+                               // do show the map for distributions\r
+                               Feature feature = ((FeatureNodeContainer) ((IStructuredSelection) selection).getFirstElement()).getFeature();\r
+                               if(!feature.equals(Feature.DISTRIBUTION())){\r
                                        showEmptyPage();\r
                                        return;\r
                                }\r
-                               \r
-                               // do not show details for feature nodes TODO really? \r
-                               if(structuredSelection.getFirstElement() instanceof FeatureNodeContainer){\r
-                                       // do show the map for distributions\r
-                                       Feature feature = ((FeatureNodeContainer) ((IStructuredSelection) selection).getFirstElement()).getFeature();\r
-                                       if(!feature.equals(Feature.DISTRIBUTION())){\r
-                                               showEmptyPage();\r
-                                               return;\r
-                                       }\r
-                               }\r
-                               \r
-                               showViewer(part, structuredSelection);\r
-                       }else{\r
-                               showEmptyPage();                \r
-                       }       \r
+                       }\r
                        \r
-               }\r
+                       showViewer(part, structuredSelection);\r
+               }else{\r
+                       showEmptyPage();                \r
+               }       \r
                \r
-               @Override\r
-               public Viewer getViewer() {\r
-                       return viewer;\r
-               }\r
+       }\r
+       \r
+       @Override\r
+       public Viewer getViewer() {\r
+               return viewer;\r
+       }\r
 \r
-               /** {@inheritDoc} */\r
-               @Override\r
-               public void dispose() {\r
-                       super.dispose();\r
-                       selectionService.removePostSelectionListener(this);\r
-               }\r
+       /** {@inheritDoc} */\r
+       @Override\r
+       public void dispose() {\r
+               super.dispose();\r
+               selectionService.removePostSelectionListener(this);\r
+       }\r
 \r
-               /**\r
-                * <p>onComplete</p>\r
-                *\r
-                * @return a boolean.\r
-                */\r
-               public boolean onComplete() {\r
-                       return true;\r
-               }\r
+       /**\r
+        * <p>onComplete</p>\r
+        *\r
+        * @return a boolean.\r
+        */\r
+       public boolean onComplete() {\r
+               return true;\r
+       }\r
 \r
                \r
 \r
                \r
 \r
        \r
-       }\r
+}\r
index 47be20f44dc6e92f5e1acba77f52f5cd9d6c3da6..38e294d5d36df79a0a039a6157da22c9bcc4f9cb 100644 (file)
@@ -12,21 +12,14 @@ import eu.etaxonomy.cdm.model.common.TermVocabulary;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;\r
-import eu.etaxonomy.cdm.model.reference.Reference;\r
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
 import eu.etaxonomy.taxeditor.ui.element.RootElement;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;\r
-import eu.etaxonomy.taxeditor.ui.section.description.DescribedSpecimenSection;\r
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionDetailSection;\r
-import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailSection;\r
-import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementMediaSection;\r
-import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementSourceSection;\r
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionSourceSection;\r
-import eu.etaxonomy.taxeditor.ui.section.description.NaturalLanguageSection;\r
-import eu.etaxonomy.taxeditor.ui.section.description.ScopeSection;\r
 import eu.etaxonomy.taxeditor.ui.section.name.NameRelationshipDetailSection;\r
 import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;\r
 import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;\r
@@ -42,9 +35,13 @@ import eu.etaxonomy.taxeditor.view.AbstractCdmDataViewer;
 import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;\r
 \r
 \r
-\r
-\r
-\r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys     \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
 public class UseRecordsViewer extends AbstractCdmDataViewer {\r
 \r
        private ISelection selection;\r