-// $Id$
/**
* Copyright (C) 2007 EDIT
* European Distributed Institute of Taxonomy
import org.eclipse.swt.widgets.Shell;
-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;
/**
* @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) {
- NameSelectionDialog dialog = new NameSelectionDialog(shell, conversation,
+ 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) {
- super(shell, conversation, title, multi, NameSelectionDialog.class.getCanonicalName(), 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() {
- model = CdmStore.getService(INameService.class).getUuidAndTitleCache();
- }
+// @Override
+// protected void search() {
+// Control control =getSearchField();
+// String pattern = null;
+// if (control != null){
+// pattern = ((Text)control).getText();
+// }
+//
+// if (pattern.equals("?")){
+// model = CdmStore.getService(INameService.class).getUuidAndTitleCache(null, null);
+// }else if (pattern != null){
+// model = CdmStore.getService(INameService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
+// }
+// }
/** {@inheritDoc} */
@Override
/** {@inheritDoc} */
@Override
- protected String getNewWizardLinkText() {
- return String.format("Create a new <a>%1s</a>", "Name ");
+ protected String[] getNewWizardText() {
+ return new String[]{"New Name"};
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.dialog.selection.AbstractFilteredCdmResourceSelectionDialog#callService(java.lang.String)
+ */
+ @Override
+ void callService(String pattern) {
+ model = CdmStore.getService(INameService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
+ }
}