-// $Id$\r
-/**\r
-* Copyright (C) 2016 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.ui.dialog.selection;\r
-\r
-import org.eclipse.swt.widgets.Shell;\r
-\r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
-import eu.etaxonomy.cdm.api.service.IAgentService;\r
-import eu.etaxonomy.cdm.model.agent.AgentBase;\r
-import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;\r
-import eu.etaxonomy.taxeditor.store.CdmStore;\r
-\r
-/**\r
- * @author k.luther\r
- * @date 25.05.2016\r
- *\r
- */\r
-public class NomenclaturalAuthorSelectionDialog extends AgentSelectionDialog {\r
-\r
-\r
- /**\r
- * @param shell\r
- * @param conversation\r
- * @param title\r
- * @param multi\r
- * @param settings\r
- * @param agent\r
- */\r
- protected NomenclaturalAuthorSelectionDialog(Shell shell, ConversationHolder conversation, String title,\r
- boolean multi, String settings, AgentBase agent) {\r
- super(shell, conversation, title, multi, settings, agent);\r
- // TODO Auto-generated constructor stub\r
- }\r
-\r
- @Override\r
- protected void initModel() {\r
- model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(null, null, null);\r
- }\r
-\r
- /**\r
- * <p>select</p>\r
- *\r
- * @param shell a {@link org.eclipse.swt.widgets.Shell} object.\r
- * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.\r
- * @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.\r
- * @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.\r
- */\r
- public static AgentBase select(Shell shell, ConversationHolder conversation, AgentBase entity) {\r
- NomenclaturalAuthorSelectionDialog dialog = new NomenclaturalAuthorSelectionDialog(shell, conversation,\r
- "Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity);\r
- return getSelectionFromDialog(dialog);\r
- }\r
-\r
- /**\r
- * <p>getTitle</p>\r
- *\r
- * @param cdmObject a T object.\r
- * @return a {@link java.lang.String} object.\r
- */\r
- @Override\r
- protected String getTitle(AgentBase cdmObject) {\r
- if(cdmObject == null){\r
- return "";\r
- }\r
-\r
- if (cdmObject instanceof TeamOrPersonBase) {\r
- return ((TeamOrPersonBase) cdmObject).getNomenclaturalTitle();\r
- } else if (cdmObject instanceof AgentBase){\r
- return ((TeamOrPersonBase) cdmObject).getTitleCache();\r
- }\r
-\r
- throw new IllegalArgumentException("Generic method only" +\r
- " supports cdmObject of type IIdentifiableEntity." +\r
- " Please implement specific method in subclass.");\r
- }\r
-\r
-}\r
+// $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.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.TeamOrPersonBase;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author k.luther
+ * @date 25.05.2016
+ *
+ */
+public class NomenclaturalAuthorSelectionDialog extends AgentSelectionDialog {
+
+
+ /**
+ * @param shell
+ * @param conversation
+ * @param title
+ * @param multi
+ * @param settings
+ * @param agent
+ */
+ protected NomenclaturalAuthorSelectionDialog(Shell shell, ConversationHolder conversation, String title,
+ boolean multi, String settings, AgentBase agent) {
+ super(shell, conversation, title, multi, settings, agent);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ protected void initModel() {
+ model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(null, null, null);
+ }
+
+ /**
+ * <p>select</p>
+ *
+ * @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) {
+ NomenclaturalAuthorSelectionDialog dialog = new NomenclaturalAuthorSelectionDialog(shell, conversation,
+ "Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity);
+ return getSelectionFromDialog(dialog);
+ }
+
+ /**
+ * <p>getTitle</p>
+ *
+ * @param cdmObject a T object.
+ * @return a {@link java.lang.String} object.
+ */
+ @Override
+ protected String getTitle(AgentBase cdmObject) {
+ if(cdmObject == null){
+ return "";
+ }
+
+ if (cdmObject instanceof TeamOrPersonBase) {
+ return ((TeamOrPersonBase) cdmObject).getNomenclaturalTitle();
+ } else if (cdmObject instanceof AgentBase){
+ return ((TeamOrPersonBase) cdmObject).getTitleCache();
+ }
+
+ throw new IllegalArgumentException("Generic method only" +
+ " supports cdmObject of type IIdentifiableEntity." +
+ " Please implement specific method in subclass.");
+ }
+
+}
-// $Id$\r
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.taxeditor.ui.dialog.selection;\r
-\r
-import java.util.UUID;\r
-\r
-import org.eclipse.swt.widgets.Shell;\r
-\r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;\r
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;\r
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;\r
-import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;\r
-import eu.etaxonomy.taxeditor.newWizard.NewDerivedUnitBaseWizard;\r
-import eu.etaxonomy.taxeditor.store.CdmStore;\r
-\r
-/**\r
- * @author pplitzner\r
- */\r
-public class SpecimenOrObservationBaseSelectionDialog extends\r
- AbstractFilteredCdmResourceSelectionDialog<SpecimenOrObservationBase> {\r
-\r
- public static SpecimenOrObservationBase select(Shell shell, ConversationHolder conversation, SpecimenOrObservationBase observation){\r
- SpecimenOrObservationBaseSelectionDialog dialog = new SpecimenOrObservationBaseSelectionDialog(shell, conversation,\r
- "Choose field unit or derived unit", false, SpecimenOrObservationBaseSelectionDialog.class.getCanonicalName(), observation);\r
- return getSelectionFromDialog(dialog);\r
- }\r
-\r
- protected SpecimenOrObservationBaseSelectionDialog(Shell shell, ConversationHolder conversation,\r
- String title, boolean multi, String settings,\r
- SpecimenOrObservationBase cdmObject) {\r
- super(shell, conversation, title, multi, settings, cdmObject);\r
- }\r
-\r
- /** {@inheritDoc} */\r
- @Override\r
- protected SpecimenOrObservationBase getPersistentObject(UUID uuid) {\r
- Object object = CdmStore.getService(IOccurrenceService.class).load(uuid);\r
- return HibernateProxyHelper.deproxy(object, SpecimenOrObservationBase.class);\r
- }\r
-\r
- /** {@inheritDoc} */\r
- @Override\r
- protected void initModel() {\r
- model = CdmStore.getService(IOccurrenceService.class).getUuidAndTitleCache(null, null);\r
- }\r
-\r
- /** {@inheritDoc} */\r
- @Override\r
- protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {\r
- return new NewDerivedUnitBaseWizard();\r
- }\r
-\r
- /** {@inheritDoc} */\r
- @Override\r
- protected String getNewWizardLinkText() {\r
- return String.format("Create a new <a>%1s</a>", "field unit/derived unit");\r
- }\r
-}\r
+// $Id$
+/**
+* Copyright (C) 2007 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 java.util.UUID;
+
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
+import eu.etaxonomy.taxeditor.newWizard.NewDerivedUnitBaseWizard;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author pplitzner
+ */
+public class SpecimenOrObservationBaseSelectionDialog extends
+ AbstractFilteredCdmResourceSelectionDialog<SpecimenOrObservationBase> {
+
+ public static SpecimenOrObservationBase select(Shell shell, ConversationHolder conversation, SpecimenOrObservationBase observation){
+ SpecimenOrObservationBaseSelectionDialog dialog = new SpecimenOrObservationBaseSelectionDialog(shell, conversation,
+ "Choose field unit or derived unit", false, SpecimenOrObservationBaseSelectionDialog.class.getCanonicalName(), observation);
+ return getSelectionFromDialog(dialog);
+ }
+
+ protected SpecimenOrObservationBaseSelectionDialog(Shell shell, ConversationHolder conversation,
+ String title, boolean multi, String settings,
+ SpecimenOrObservationBase cdmObject) {
+ super(shell, conversation, title, multi, settings, cdmObject);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected SpecimenOrObservationBase getPersistentObject(UUID uuid) {
+ Object object = CdmStore.getService(IOccurrenceService.class).load(uuid);
+ return HibernateProxyHelper.deproxy(object, SpecimenOrObservationBase.class);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected void initModel() {
+ model = CdmStore.getService(IOccurrenceService.class).getUuidAndTitleCache(null, null);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
+ return new NewDerivedUnitBaseWizard();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected String getNewWizardLinkText() {
+ return String.format("Create a new <a>%1s</a>", "field unit/derived unit");
+ }
+}