/**
- *
- */
+* Copyright (C) 2018 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.section.description;
import java.util.Collection;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
- * <p>
* DescriptionElementSourceSection class.
- * </p>
*
* @author n.hoffmann
* @created Nov 17, 2009
- * @version 1.0
*/
public class DescriptionElementSourceSection extends
AbstractEntityCollectionSection<DescriptionElementBase, OriginalSourceBase> {
private Reference defaultSource;
-
- /**
- * <p>
- * Constructor for DescriptionElementSourceSection.
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param style
- * a int.
- * @param cdmFormFactory
- * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
- * object.
- * @param conversation
- * a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
- * object.
- */
public DescriptionElementSourceSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
ICdmFormElement parentElement, int style) {
super(cdmFormFactory, conversation, parentElement, "Sources", style);
}
- /**
- * <p>
- * Constructor for DescriptionElementSourceSection.
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param style
- * a int.
- * @param cdmFormFactory
- * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
- * object.
- * @param defaultSource
- * a default reference for new sources.
- * @param conversation
- * a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
- * object.
- */
public DescriptionElementSourceSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
ICdmFormElement parentElement, Reference defaultSource, int style) {
super(cdmFormFactory, conversation, parentElement, "Sources", style);
this.defaultSource = defaultSource;
}
- /** {@inheritDoc} */
@Override
public DescriptionElementSource createNewElement() {
DescriptionElementSource source = DescriptionElementSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource);
return source;
}
- /** {@inheritDoc} */
@Override
public Collection<OriginalSourceBase> getCollection(DescriptionElementBase entity) {
- Collection<OriginalSourceBase> sources = new HashSet();
+ Collection<OriginalSourceBase> sources = new HashSet<>();
sources.addAll(entity.getSources());
sources.addAll(entity.getInDescription().getSources());
return sources;
@Override
public Comparator<OriginalSourceBase> getComparator() {
- return new SourceComparator();
+ return new SourceComparator<>();
}
- /** {@inheritDoc} */
@Override
public String getEmptyString() {
return "No references yet.";
}
- /** {@inheritDoc} */
@Override
protected String getTooltipString() {
return "Create a new reference";
}
- /** {@inheritDoc} */
@Override
public void addElement(OriginalSourceBase element) {
if (element instanceof DescriptionElementSource){
}
}
- /** {@inheritDoc} */
@Override
public void removeElement(OriginalSourceBase element) {
if (element instanceof DescriptionElementSource){
}
}
- /**
- * {@inheritDoc}
- */
@Override
public DescriptionElementSource addExisting() {
return null;
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean allowAddExisting() {
return false;
}
-
-
-}
+}
\ No newline at end of file