merge-update from trunk
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 26 Nov 2013 07:59:07 +0000 (07:59 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 26 Nov 2013 07:59:07 +0000 (07:59 +0000)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/OccurrenceEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/DeleteNodeOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PointElement.java

index 296a07090048a91c5faf8fe6909e1183c7db069e..3f9858869e2122aae96a64f0b947fca3f85008f9 100644 (file)
@@ -16,6 +16,7 @@ import java.util.UUID;
 
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
@@ -100,6 +101,17 @@ public class OccurrenceEditorInput extends AbstractBulkEditorInput<SpecimenOrObs
                return getName();
        }
 
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getTypeText(java.lang.Object)
+        */
+       @Override
+       public String getTypeText(Object entity) {
+        if(HibernateProxyHelper.isInstanceOf(entity, SpecimenOrObservationBase.class)){
+            return ((SpecimenOrObservationBase) entity).getRecordBasis().getMessage();
+         }
+           return super.getTypeText(entity);
+       }
+
        /**
         * <p>getId</p>
         *
index dc054de2ef665819867a72509840b0edf4e498c5..25bef92d7760429f17f85696e4c2ddcd2e1cf151 100644 (file)
@@ -9,9 +9,13 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationController;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * @author n.hoffmann
@@ -40,7 +44,14 @@ public class DeleteNodeOperation extends AbstractPostOperation {
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
 
-               parent.removeChild(node);
+               //parent.removeChild(node);
+               CdmApplicationController controller;
+               
+               controller = (CdmApplicationController) CdmStore.getCurrentApplicationConfiguration();
+               
+               IPolytomousKeyNodeService service = controller.getPolytomousKeyNodeService();
+               
+               service.delete(node, true);
 
                return postExecute(null);
        }
index 9dd0a9c67327ee4d396a95f5ad680b32d13cea3d..30a9ce77d2e561c383f859c08b1f9da83acf4424 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * 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.
  */
@@ -24,7 +24,7 @@ import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
  * <p>
  * PointElement class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Oct 15, 2010
  * @version 1.0
@@ -47,7 +47,7 @@ public class PointElement extends AbstractCdmFormElement implements
         * <p>
         * Constructor for PointElement.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -66,12 +66,12 @@ public class PointElement extends AbstractCdmFormElement implements
                formFactory.addPropertyChangeListener(this);
 
                text_latitude = formFactory.createTextWithLabelElement(formElement,
-                               "Latitude (hexagesimal)", null, style);
+                               "Latitude", null, style);
                text_latitudeParsed = formFactory.createTextWithLabelElement(
                                formElement, "", null, style);
                text_latitudeParsed.setEnabled(false);
                text_longitude = formFactory.createTextWithLabelElement(formElement,
-                               "Longitude (hexagesimal)", null, style);
+                               "Longitude", null, style);
                text_longitudeParsed = formFactory.createTextWithLabelElement(
                                formElement, "", null, style);
                text_longitudeParsed.setEnabled(false);
@@ -86,7 +86,7 @@ public class PointElement extends AbstractCdmFormElement implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#propertyChange(org
         * .eclipse.jface.util.PropertyChangeEvent)
@@ -140,7 +140,7 @@ public class PointElement extends AbstractCdmFormElement implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.forms.IEntityElement#getEntity()
         */
        /** {@inheritDoc} */
@@ -153,7 +153,7 @@ public class PointElement extends AbstractCdmFormElement implements
         * <p>
         * setEntity
         * </p>
-        * 
+        *
         * @param point
         *            a {@link eu.etaxonomy.cdm.model.location.Point} object.
         */
@@ -165,7 +165,7 @@ public class PointElement extends AbstractCdmFormElement implements
         * <p>
         * Setter for the field <code>point</code>.
         * </p>
-        * 
+        *
         * @param point
         *            the point to set
         */
@@ -189,7 +189,7 @@ public class PointElement extends AbstractCdmFormElement implements
         * <p>
         * Getter for the field <code>point</code>.
         * </p>
-        * 
+        *
         * @return the point
         */
        public Point getPoint() {
@@ -200,8 +200,9 @@ public class PointElement extends AbstractCdmFormElement implements
                return point;
        }
 
-       public void setSelected(boolean selected) {
+       @Override
+    public void setSelected(boolean selected) {
                setBackground(selected ? SELECTED : getPersistentBackground());
        }
-       
+
 }