X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/blobdiff_plain/d776839bd91a9c34523268d7d53f1cb65b61ae03..deec2311a69183f731cc1e6ddf7f967cba6c0241:/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NameSelectionDialog.java diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NameSelectionDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NameSelectionDialog.java index c9effb37d..f810756ef 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NameSelectionDialog.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NameSelectionDialog.java @@ -1,9 +1,8 @@ -// $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. */ @@ -14,68 +13,52 @@ import java.util.UUID; 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; /** - *
FilteredNameSelectionDialog class.
- * * @author n.hoffmann * @created 04.06.2009 - * @version 1.0 */ -public class NameSelectionDialog extends AbstractFilteredCdmResourceSelectionDialogConstructor for FilteredNameSelectionDialog.
- * - * @param shell a {@link org.eclipse.swt.widgets.Shell} object. - * @param title a {@link java.lang.String} object. - * @param name a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object. - * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. - * @param multi a boolean. - */ - 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); } - /* (non-Javadoc) - * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID) - */ /** {@inheritDoc} */ @Override - protected TaxonNameBase getPersistentObject(UUID cdmUuid) { + protected TaxonName getPersistentObject(UUID cdmUuid) { return CdmStore.getService(INameService.class).load(cdmUuid); } - /* (non-Javadoc) - * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#initModel() - */ /** {@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 @@ -85,7 +68,15 @@ public class NameSelectionDialog extends AbstractFilteredCdmResourceSelectionDia /** {@inheritDoc} */ @Override - protected String getNewWizardLinkText() { - return "Click here to create a new 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); + } }