remove SelectionViewMenu because it is not used anymore
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / dialog / selection / NameSelectionDialog.java
index b42a1e4048f7822cc4ac3d0fc1c2fbaf5f51cdc0..92b8278858cc83410f9061d3312a60954ed65851 100644 (file)
@@ -17,7 +17,7 @@ import org.eclipse.swt.widgets.Text;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.INameService;
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.newWizard.NewNonViralNameWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -25,37 +25,39 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 /**
  * @author n.hoffmann
  * @created 04.06.2009
- * @version 1.0
  */
-public class NameSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<TaxonNameBase> {
+public class NameSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<TaxonName> {
 
-       public static TaxonNameBase select(Shell shell, ConversationHolder conversation, TaxonNameBase name) {
+       public static TaxonName select(Shell shell, ConversationHolder conversation, TaxonName name) {
                NameSelectionDialog dialog = new NameSelectionDialog(shell, conversation,
                                "Choose a name", false, name);
                return getSelectionFromDialog(dialog);
        }
 
-       protected NameSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, TaxonNameBase name) {
+       protected NameSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, TaxonName name) {
                super(shell, conversation, title, multi, NameSelectionDialog.class.getCanonicalName(), name);
        }
 
        /** {@inheritDoc} */
        @Override
-       protected TaxonNameBase getPersistentObject(UUID cdmUuid) {
+       protected TaxonName getPersistentObject(UUID cdmUuid) {
                return CdmStore.getService(INameService.class).load(cdmUuid);
        }
 
        /** {@inheritDoc} */
        @Override
-       protected void initModel() {
-           Control control = getPatternControl();
+       protected void search() {
+           Control control =getSearchField();
         String pattern = null;
         if (control != null){
             pattern = ((Text)control).getText();
         }
 
-
-               model = CdmStore.getService(INameService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
+        if (pattern == null || pattern.equals("?")){
+            model = CdmStore.getService(INameService.class).getUuidAndTitleCache(null, null);
+        }else{
+            model = CdmStore.getService(INameService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
+        }
        }
 
        /** {@inheritDoc} */
@@ -66,7 +68,7 @@ public class NameSelectionDialog extends AbstractFilteredCdmResourceSelectionDia
 
        /** {@inheritDoc} */
        @Override
-       protected String getNewWizardLinkText() {
-               return String.format("Create a new <a>%1s</a>", "Name ");
+       protected String[] getNewWizardText() {
+               return new String[]{"Name "};
        }
 }