-// $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.
*/
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.common.OriginalSourceType;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.OriginalSourceTypeSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
*/
public class DescriptionSourceSection extends
AbstractEntityCollectionSection<DescriptionBase, IdentifiableSource>{
-
+
/**
* <p>Constructor for DescriptionSourceSection.</p>
*
super(cdmFormFactory, conversation, parentElement, "Description Sources", style);
}
-
+
/** {@inheritDoc} */
@Override
/** {@inheritDoc} */
@Override
public IdentifiableSource createNewElement() {
- return IdentifiableSource.NewInstance();
+ OriginalSourceType ost = OriginalSourceTypeSelectionDialog.select(getShell(), getConversationHolder());
+ if(ost != null) {
+ return IdentifiableSource.NewInstance(ost);
+ } else {
+ return null;
+ }
}
/** {@inheritDoc} */
public void removeElement(IdentifiableSource element) {
getEntity().removeSource(element);
}
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IdentifiableSource addExisting() {
+ return null;
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean allowAddExisting() {
+ return false;
+ }
}