From cf90f1976a5e9edf381631343a3979041a913d3a Mon Sep 17 00:00:00 2001 From: Katja Luther Date: Tue, 21 Jun 2016 13:47:02 +0200 Subject: [PATCH] new NomenclaturalPersonAuthorSelectionDialog --- ...enclaturalPersonAuthorSelectionDialog.java | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalPersonAuthorSelectionDialog.java diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalPersonAuthorSelectionDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalPersonAuthorSelectionDialog.java new file mode 100644 index 000000000..0e700202c --- /dev/null +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalPersonAuthorSelectionDialog.java @@ -0,0 +1,69 @@ +// $Id$ +/** +* Copyright (C) 2016 EDIT +* 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. +*/ +package eu.etaxonomy.taxeditor.ui.dialog.selection; + +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +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.Person; +import eu.etaxonomy.taxeditor.store.CdmStore; + +/** + * @author k.luther + * @date 21.06.2016 + * + */ +public class NomenclaturalPersonAuthorSelectionDialog extends NomenclaturalAuthorSelectionDialog { + + /** + * @param shell + * @param conversation + * @param title + * @param multi + * @param settings + * @param agent + */ + protected NomenclaturalPersonAuthorSelectionDialog(Shell shell, ConversationHolder conversation, String title, + boolean multi, String settings, AgentBase agent) { + super(shell, conversation, title, multi, settings, agent); + // TODO Auto-generated constructor stub + } + + + /** + *

select

+ * + * @param shell a {@link org.eclipse.swt.widgets.Shell} object. + * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. + * @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object. + * @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object. + */ + public static AgentBase select(Shell shell, ConversationHolder conversation, AgentBase entity) { + NomenclaturalPersonAuthorSelectionDialog dialog = new NomenclaturalPersonAuthorSelectionDialog(shell, conversation, + "Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity); + return getSelectionFromDialog(dialog); + } + + @Override + protected void initModel() { + Control control = getPatternControl(); + String pattern = null; + if (control != null){ + pattern = ((Text)control).getText(); + } + + model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(limitOfInitialElements, pattern, Person.class); + } + +} -- 2.34.1