revert changes in selection dialogs for enums
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / dialog / selection / DerivedUnitSelectionDialog.java
index b93e2d40e6640de022df4f6ed61d088f41bbf913..2907566c340b415b2287272489dcceb911507193 100644 (file)
@@ -1,9 +1,8 @@
-// $Id$
 /**
 * Copyright (C) 2007 EDIT
 /**
 * 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.
 */
@@ -19,10 +18,10 @@ import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.newWizard.NewDerivedUnitBaseWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.newWizard.NewDerivedUnitBaseWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>FilteredDerivedUnitSelectionDialog class.</p>
 
 /**
  * <p>FilteredDerivedUnitSelectionDialog class.</p>
@@ -47,7 +46,7 @@ public class DerivedUnitSelectionDialog extends
                                "Choose Unit", false, DerivedUnitSelectionDialog.class.getCanonicalName(), unit);
                return getSelectionFromDialog(dialog);
        }
                                "Choose Unit", false, DerivedUnitSelectionDialog.class.getCanonicalName(), unit);
                return getSelectionFromDialog(dialog);
        }
-       
+
        /**
         * <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
         *
        /**
         * <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
         *
@@ -62,25 +61,25 @@ public class DerivedUnitSelectionDialog extends
                        boolean multi, String settings, DerivedUnit cdmObject) {
                super(shell, conversation, title, multi, settings, cdmObject);
        }
                        boolean multi, String settings, DerivedUnit cdmObject) {
                super(shell, conversation, title, multi, settings, cdmObject);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        protected DerivedUnit getPersistentObject(UUID uuid) {
                Object object = CdmStore.getService(IOccurrenceService.class).load(uuid);
        /** {@inheritDoc} */
        @Override
        protected DerivedUnit getPersistentObject(UUID uuid) {
                Object object = CdmStore.getService(IOccurrenceService.class).load(uuid);
-               
+
                SpecimenOrObservationBase specimenObservationBase = (SpecimenOrObservationBase) HibernateProxyHelper.deproxy(object);
                SpecimenOrObservationBase specimenObservationBase = (SpecimenOrObservationBase) HibernateProxyHelper.deproxy(object);
-               
-               if(specimenObservationBase instanceof DerivedUnit){     
-                       return (DerivedUnit) specimenObservationBase; 
+
+               if(specimenObservationBase instanceof DerivedUnit){
+                       return (DerivedUnit) specimenObservationBase;
                }
                }
-               StoreUtil.error(this.getClass(), "Selected unit is not a derived unit", null);
-               return null;            
+               MessagingUtils.error(this.getClass(), "Selected unit is not a derived unit", null);
+               return null;
        }
 
        /** {@inheritDoc} */
        @Override
        }
 
        /** {@inheritDoc} */
        @Override
-       protected void initModel() {
-               model = CdmStore.getService(IOccurrenceService.class).getDerivedUnitBaseUuidAndTitleCache();
+       protected void search() {
+               model = CdmStore.getService(IOccurrenceService.class).getDerivedUnitUuidAndTitleCache();
        }
 
        /** {@inheritDoc} */
        }
 
        /** {@inheritDoc} */
@@ -92,6 +91,6 @@ public class DerivedUnitSelectionDialog extends
        /** {@inheritDoc} */
        @Override
        protected String getNewWizardLinkText() {
        /** {@inheritDoc} */
        @Override
        protected String getNewWizardLinkText() {
-               return "Click link to create a new <A>Unit</A>.";
+               return String.format("Create a new <a>%1s</a>", "Unit ");
        }
 }
        }
 }