-// $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.IAgentService;
+import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
import eu.etaxonomy.taxeditor.newWizard.NewTeamWizard;
import eu.etaxonomy.taxeditor.store.CdmStore;
* @version 1.0
*/
public class NomenclaturalAuthorTeamSelectionDialog extends
- AbstractFilteredCdmResourceSelectionDialog<Team> {
+ AbstractFilteredCdmResourceSelectionDialog<AgentBase> {
/**
* <p>select</p>
* @param team a {@link eu.etaxonomy.cdm.model.agent.Team} object.
* @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
*/
- public static Team select(Shell shell, ConversationHolder conversation, Team team){
- NomenclaturalAuthorTeamSelectionDialog dialog = new NomenclaturalAuthorTeamSelectionDialog(shell, conversation,
+ public static Team select(Shell shell, //ConversationHolder conversation,
+ Team team){
+ NomenclaturalAuthorTeamSelectionDialog dialog = new NomenclaturalAuthorTeamSelectionDialog(shell, //conversation,
"Choose Author Team", false, NomenclaturalAuthorTeamSelectionDialog.class.getCanonicalName(), team);
- return getSelectionFromDialog(dialog);
+ return (Team)getSelectionFromDialog(dialog);
}
/**
* @param settings a {@link java.lang.String} object.
* @param agent a {@link eu.etaxonomy.cdm.model.agent.Team} object.
*/
- protected NomenclaturalAuthorTeamSelectionDialog(Shell shell, ConversationHolder conversation, String title,
+ protected NomenclaturalAuthorTeamSelectionDialog(Shell shell, //ConversationHolder conversation,
+ String title,
boolean multi, String settings, Team agent) {
- super(shell, conversation, title, multi, settings, agent);
+ super(shell, //conversation,
+ title, multi, settings, agent);
}
/** {@inheritDoc} */
@Override
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
- return new NewTeamWizard();
+ return new NewTeamWizard(true);
}
/** {@inheritDoc} */
@Override
- protected String getNewWizardLinkText() {
- return String.format("Create a new <a>%1s</a>", "Team ");
+ protected String[] getNewWizardText() {
+ return new String[]{"new Team"};
}
- /** {@inheritDoc} */
- @Override
- protected void initModel() {
- model = CdmStore.getService(IAgentService.class).getTeamUuidAndNomenclaturalTitle();
- }
+// /** {@inheritDoc} */
+// @Override
+// protected void search() {
+// Control control =getSearchField();
+// String pattern = null;
+// if (control != null){
+// pattern = ((Text)control).getText();
+// }
+//
+// model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(limitOfInitialElements, pattern, Team.class);
+// }
/** {@inheritDoc} */
@Override
protected Team getPersistentObject(UUID uuid) {
- return (Team) CdmStore.getService(IAgentService.class).load(uuid);
+ return CdmBase.deproxy(CdmStore.getService(IAgentService.class).load(uuid), Team.class) ;
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.dialog.selection.AbstractFilteredCdmResourceSelectionDialog#callService(java.lang.String)
+ */
+ @Override
+ void callService(String pattern) {
+ model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(limitOfInitialElements, pattern, Team.class);
+ }
}