-// $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.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.service.ITaxonService;
-import eu.etaxonomy.cdm.model.taxon.Synonym;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * <p>FilteredTaxonBaseSelectionDialog class.</p>
- *
- * @author n.hoffmann
- * @created Sep 21, 2009
- * @version 1.0
- */
-public class TaxonBaseSelectionDialog extends
- AbstractFilteredCdmResourceSelectionDialog<TaxonBase> {
-
- /**
- * <p>select</p>
- *
- * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
- * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
- * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
- */
- public static TaxonBase selectTaxonBase(Shell shell, ConversationHolder conversation) {
- TaxonBaseSelectionDialog dialog = new TaxonBaseSelectionDialog(TaxonBase.class, shell, conversation,
- "Choose a taxon", false, null);
- return getSelectionFromDialog(dialog);
- }
-
- /**
- * <p>select</p>
- *
- * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
- * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
- * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
- */
- public static Taxon selectTaxon(Shell shell, ConversationHolder conversation) {
- TaxonBaseSelectionDialog dialog = new TaxonBaseSelectionDialog(Taxon.class, shell, conversation,
- "Choose a taxon", false, null);
- return (Taxon) getSelectionFromDialog(dialog);
- }
-
- /**
- * <p>select</p>
- *
- * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
- * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
- * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
- */
- public static Synonym selectSynonym(Shell shell, ConversationHolder conversation) {
- TaxonBaseSelectionDialog dialog = new TaxonBaseSelectionDialog(Synonym.class, shell, conversation,
- "Choose a taxon", false, null);
- return (Synonym) getSelectionFromDialog(dialog);
- }
-
- private final Class<? extends TaxonBase> clazz;
-
- /**
- * <p>Constructor for FilteredTaxonBaseSelectionDialog.</p>
- *
- * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
- * @param title a {@link java.lang.String} object.
- * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
- * @param multi a boolean.
- * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
- */
- protected TaxonBaseSelectionDialog(Class<? extends TaxonBase> clazz, Shell shell, ConversationHolder conversation, String title, boolean multi, TaxonBase taxon) {
- super(shell, conversation, title, multi, ReferenceSelectionDialog.class.getCanonicalName(), taxon);
- this.clazz = clazz;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea(org.eclipse.swt.widgets.Composite)
- */
- /** {@inheritDoc} */
- @Override
- protected Control createExtendedContentArea(Composite parent) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
- */
- /** {@inheritDoc} */
- @Override
- protected TaxonBase getPersistentObject(UUID uuid) {
- return CdmStore.getService(ITaxonService.class).load(uuid);
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#initModel()
- */
- /** {@inheritDoc} */
- @Override
- protected void initModel() {
- if(clazz == TaxonBase.class){
- model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCache();
- }
- else if(clazz == Taxon.class){
- model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCacheTaxon();
- }
- else if(clazz == Synonym.class){
- model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCacheSynonym();
- }
- }
-
- /** {@inheritDoc} */
- @Override
- protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
- return null;
- }
-
- /** {@inheritDoc} */
- @Override
- protected String getNewWizardLinkText() {
- return null;
- }
-}
+// $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.Composite;\r
+import org.eclipse.swt.widgets.Control;\r
+import org.eclipse.swt.widgets.Shell;\r
+\r
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
+import eu.etaxonomy.cdm.api.service.ITaxonService;\r
+import eu.etaxonomy.cdm.model.taxon.Synonym;\r
+import eu.etaxonomy.cdm.model.taxon.Taxon;\r
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
+import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
+\r
+/**\r
+ * <p>FilteredTaxonBaseSelectionDialog class.</p>\r
+ *\r
+ * @author n.hoffmann\r
+ * @created Sep 21, 2009\r
+ * @version 1.0\r
+ */\r
+public class TaxonBaseSelectionDialog extends\r
+ AbstractFilteredCdmResourceSelectionDialog<TaxonBase> {\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
+ * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.\r
+ */\r
+ public static TaxonBase selectTaxonBase(Shell shell, ConversationHolder conversation) {\r
+ AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(TaxonBase.class, shell, conversation,\r
+ "Choose a taxon", false, null, null);\r
+ return getSelectionFromDialog(dialog);\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
+ * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.\r
+ */\r
+ public static Taxon selectTaxon(Shell shell, ConversationHolder conversation, Taxon taxonToBeFiltered) {\r
+ \r
+\r
+ AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(Taxon.class, shell, conversation,\r
+ "Choose a taxon", false, null, taxonToBeFiltered);\r
+ return (Taxon) getSelectionFromDialog(dialog);\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
+ * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.\r
+ */\r
+ public static Synonym selectSynonym(Shell shell, ConversationHolder conversation) {\r
+ AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(Synonym.class, shell, conversation,\r
+ "Choose a taxon", false, null, null);\r
+ return (Synonym) getSelectionFromDialog(dialog);\r
+ }\r
+\r
+ private final Class<? extends TaxonBase> clazz;\r
+ \r
+ /**\r
+ * <p>Constructor for FilteredTaxonBaseSelectionDialog.</p>\r
+ *\r
+ * @param shell a {@link org.eclipse.swt.widgets.Shell} object.\r
+ * @param title a {@link java.lang.String} object.\r
+ * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.\r
+ * @param multi a boolean.\r
+ * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.\r
+ */\r
+ protected TaxonBaseSelectionDialog(Class<? extends TaxonBase> clazz, Shell shell, ConversationHolder conversation, String title, boolean multi, TaxonBase taxon, TaxonBase taxonToBeFiltered) {\r
+ super(shell, conversation, title, multi, ReferenceSelectionDialog.class.getCanonicalName(), taxon);\r
+ this.cdmBaseToBeFiltered = taxonToBeFiltered;\r
+\r
+ \r
+ \r
+ this.clazz = clazz;\r
+ }\r
+\r
+ /* (non-Javadoc)\r
+ * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea(org.eclipse.swt.widgets.Composite)\r
+ */\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ protected Control createExtendedContentArea(Composite parent) {\r
+ return null;\r
+ }\r
+\r
+ /* (non-Javadoc)\r
+ * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)\r
+ */\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ protected TaxonBase getPersistentObject(UUID uuid) {\r
+ return CdmStore.getService(ITaxonService.class).load(uuid);\r
+ }\r
+\r
+ /* (non-Javadoc)\r
+ * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#initModel()\r
+ */\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ protected void initModel() {\r
+ if(clazz == TaxonBase.class){\r
+ model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCache();\r
+ }\r
+ else if(clazz == Taxon.class){\r
+ \r
+ model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCacheTaxon();\r
+ \r
+ }\r
+ else if(clazz == Synonym.class){\r
+ model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCacheSynonym();\r
+ }\r
+ }\r
+\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {\r
+ return null;\r
+ }\r
+\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ protected String getNewWizardLinkText() {\r
+ return null;\r
+ }\r
+}\r