smaller changes in selection dialog, use always the service for searching with pattern
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / dialog / selection / AgentSelectionDialog.java
index 691e909f05d2d0346bfee77a36846c82813d7dba..9b781f37e7f97d1e77f3b9e01c5585e96a1f1390 100644 (file)
@@ -11,12 +11,9 @@ package eu.etaxonomy.taxeditor.ui.dialog.selection;
 
 import java.util.UUID;
 
-import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
 
 import eu.etaxonomy.cdm.api.service.IAgentService;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
@@ -40,11 +37,11 @@ public class AgentSelectionDialog extends
        /**
         *
         */
-       protected static final String PERSON = "new Person";
+       protected static final String PERSON = "New Person";
        /**
         *
         */
-       protected static final String TEAM = "new Team";
+       protected static final String TEAM = "New Team";
 
        protected static boolean selectTeamMember;
 
@@ -148,26 +145,24 @@ public class AgentSelectionDialog extends
                return super.getNewWizardButtonSelectionListener();
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected void search() {
-           Control control = getSearchField();
-        String pattern = null;
-        if (control != null){
-            pattern = ((Text)control).getText();
-        }
-        if (pattern == null || pattern.equals("?")){
-            model = CdmStore.getService(IAgentService.class).getUuidAndTitleCache(null, null);
-        }else{
-            model = CdmStore.getService(IAgentService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
-        }
-        try {
-            fillContentProvider(null);
-        } catch (CoreException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-       }
+//     /** {@inheritDoc} */
+//     @Override
+//     protected void search() {
+//         Control control = getSearchField();
+//        String pattern = null;
+//        if (control != null){
+//            pattern = ((Text)control).getText();
+//        }
+//
+//     }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.ui.dialog.selection.AbstractFilteredCdmResourceSelectionDialog#callService(java.lang.String)
+     */
+    @Override
+    void callService(String pattern) {
+        model = CdmStore.getService(IAgentService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
+    }
 
 
 }