/**
- *
- */
+* 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.element;
-import java.net.URI;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import org.joda.time.Partial;
import org.springframework.security.core.GrantedAuthority;
+import eu.etaxonomy.cdm.common.URI;v
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.common.DOI;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.agent.ORCID;
import eu.etaxonomy.cdm.model.agent.Person;
import eu.etaxonomy.cdm.model.agent.Team;
import eu.etaxonomy.cdm.model.common.Annotation;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.Credit;
+import eu.etaxonomy.cdm.model.common.ExtendedTimePeriod;
import eu.etaxonomy.cdm.model.common.Extension;
import eu.etaxonomy.cdm.model.common.ICdmBase;
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
import eu.etaxonomy.cdm.model.description.TaxonInteraction;
+import eu.etaxonomy.cdm.model.description.TemporalData;
import eu.etaxonomy.cdm.model.description.TextData;
import eu.etaxonomy.cdm.model.location.NamedArea;
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
import eu.etaxonomy.cdm.model.term.IEnumTerm;
import eu.etaxonomy.cdm.model.term.Representation;
import eu.etaxonomy.cdm.model.term.TermBase;
+import eu.etaxonomy.cdm.model.term.TermTree;
import eu.etaxonomy.cdm.model.term.TermType;
import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.ui.section.description.detail.IndividualsAssociationDetailElement;
import eu.etaxonomy.taxeditor.ui.section.description.detail.QuantitativeDataDetailElement;
import eu.etaxonomy.taxeditor.ui.section.description.detail.TaxonInteractionDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.description.detail.TemporalDataDetailElement;
import eu.etaxonomy.taxeditor.ui.section.description.detail.TextDataDetailElement;
import eu.etaxonomy.taxeditor.ui.section.feature.CharacterDetailElement;
import eu.etaxonomy.taxeditor.ui.section.feature.CharacterDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.feature.CharacterDtoDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.feature.CharacterDtoDetailSection;
import eu.etaxonomy.taxeditor.ui.section.feature.CharacterNodeDetailElement;
import eu.etaxonomy.taxeditor.ui.section.feature.CharacterNodeDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.feature.CharacterNodeDtoDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.feature.CharacterNodeDtoDetailSection;
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailElement;
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailSection;
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureNodeDetailElement;
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureNodeDetailSection;
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureTreeDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.feature.FeatureTreeDetailElementForNode;
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureTreeDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.feature.FeatureTreeDetailSectionForNode;
import eu.etaxonomy.taxeditor.ui.section.feature.InapplicableIfCollectionElement;
import eu.etaxonomy.taxeditor.ui.section.feature.InapplicableIfEntityCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.feature.InapplicableIfEntityCollectionSectionForNode;
import eu.etaxonomy.taxeditor.ui.section.feature.OnlyApplicableIfCollectionElement;
import eu.etaxonomy.taxeditor.ui.section.feature.OnlyApplicableIfEntityCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.feature.OnlyApplicableIfEntityCollectionSectionForNode;
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityCollectionElement;
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailElement;
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailSection;
import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailElement;
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.name.ProtologueElement;
-import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
+import eu.etaxonomy.taxeditor.ui.section.name.RuleConsideredElement;
import eu.etaxonomy.taxeditor.ui.section.name.SpecimenTypeDesignationElement;
import eu.etaxonomy.taxeditor.ui.section.name.TextTypeDesignationElement;
import eu.etaxonomy.taxeditor.ui.section.name.TypeDesignationSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitGeneralDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitMediaSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationEventDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.TissueSampleGeneralDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.media.MediaSpecimenGeneralDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.media.MediaSpecimenGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.reference.AdvancedNomenclaturalSourceElement;
+import eu.etaxonomy.taxeditor.ui.section.reference.AdvancedSourceElement;
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailElement;
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalSourceElement;
+import eu.etaxonomy.taxeditor.ui.section.reference.OriginalSourceAdvancedSection;
+import eu.etaxonomy.taxeditor.ui.section.reference.OriginalSourceElement;
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailElement;
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.reference.SingleSourceSection;
import eu.etaxonomy.taxeditor.ui.section.supplemental.AnnotationElement;
import eu.etaxonomy.taxeditor.ui.section.supplemental.AnnotationSection;
import eu.etaxonomy.taxeditor.ui.section.supplemental.CdmBaseElement;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.FeatureDetailElement;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitCollectionElement;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitDtoCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitDtoCollectionSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.PresenceAbsenceTermDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierDtoVocabulariesElement;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesDtoCollectionSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesElement;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyCollectionElement;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyDtoCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyDtoCollectionSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureCollectionElement;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureDtoCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureDtoCollectionSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermMediaSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailElement;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailSection;
import eu.etaxonomy.taxeditor.ui.selection.CommonNameReferenceSelectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElementWithAbbreviatedTitle;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElementWithIdInVocabulary;
import eu.etaxonomy.taxeditor.ui.selection.NomenclaturalAuthorTeamSelectionElement;
import eu.etaxonomy.taxeditor.ui.selection.TaxonNodeSelectionElement;
import eu.etaxonomy.taxeditor.view.detail.CdmSectionPart;
/**
- * <p>
* CdmFormFactory class.
- * </p>
*
* @author n.hoffmann
* @created Feb 24, 2010
@Inject
private IEclipseContext context;
- private final Set<SelectionListener> selectionListenerList = new HashSet<SelectionListener>();
+ private final Set<SelectionListener> selectionListenerList = new HashSet<>();
- private final List<IPropertyChangeListener> propertyChangeListeners = new ArrayList<IPropertyChangeListener>();
+ private final List<IPropertyChangeListener> propertyChangeListeners = new ArrayList<>();
private final int orientation = Window.getDefaultOrientation();
private ISelectionProvider selectionProvider;
};
/**
- *
* @author n.hoffmann
* @date Jan 25, 2010
- *
*/
private class SelectionMouseHandler extends MouseAdapter {
@Override
}
/**
- *
* @author n.hoffmann
* @date Jan 25, 2010
- *
*/
private class SelectionFocusHandler extends FocusAdapter {
@Override
formElement.setPropertyChangeListeners(propertyChangeListeners);
}
- /** {@inheritDoc} */
@Override
public void adapt(Control control, boolean trackFocus, boolean trackKeyboard) {
if (trackFocus) {
super.adapt(control, trackFocus, trackKeyboard);
}
- /** {@inheritDoc} */
@Override
public void adapt(Composite composite) {
composite.addMouseListener(selectionMouseHandler);
}
/**
- * <p>
* destroyElement
- * </p>
*
* @param formElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
// parentElement.removeElement(formElement);
// }
// call destroy on child elements recursively
- for (ICdmFormElement childElement : formElement.getElements()) {
+
+ Set<ICdmFormElement> tempFormElements = new HashSet<>();
+ tempFormElements.addAll(formElement.getElements());
+ for(ICdmFormElement childElement: tempFormElements) {
destroyElement(childElement);
}
// dispose of the controls
if (control.equals(formElement.getLayoutComposite())) {
continue;
} else {
- if (control != null && !control.isDisposed()){
+ if (!control.isDisposed()){
control.dispose();
}
- control = null;
+ control = null; //needed?
}
}
}
/**
- * <p>
* createEmptyCell
- * </p>
*
* @param parent
* a {@link org.eclipse.swt.widgets.Composite} object.
}
/**
- * <p>
* createMultiLanguageTextElement
- * </p>
*
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
}
/**
- * <p>
* createMultiLanguageTextElement
- * </p>
*
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
}
/**
- * <p>
* createMultiLanguageTextElement
- * </p>
*
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
return element;
}
+ public TranslatableRepresentationElement createTranslatableRepresentationElementDto(ICdmFormElement parentElement, Representation representation, TermDto term,int textHeight, int style, boolean fillDetails) {
+ TranslatableRepresentationElement element = new TranslatableRepresentationElement(this, parentElement, representation, term, textHeight, style, fillDetails);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
+
public KeyStatementElement createKeyStatementElement(ICdmFormElement parentElement, String labelString,
KeyStatement keyStatement, int textHeight, int style) {
KeyStatementElement element = new KeyStatementElement(this, parentElement, labelString, keyStatement,
String initialText, int style) {
return createTextWithLabelElement(parentElement, labelString, initialText, null, style);
}
+
/**
- * <p>
* createTextWithLabelElement
- * </p>
*
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
return element;
}
+ public OrcidWithLabelElement createOrcidWithLabelElement(ICdmFormElement parentElement, String labelString,
+ ORCID initialDoi, int style) {
+ OrcidWithLabelElement element = new OrcidWithLabelElement(this, parentElement, labelString, initialDoi, null, style);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+ public OrcidWithLabelElement createDoiWithLabelElement(ICdmFormElement parentElement, String labelString,
+ ORCID initialDoi,Integer textHeight, int style) {
+ OrcidWithLabelElement element = new OrcidWithLabelElement(this, parentElement, labelString, initialDoi, textHeight, style);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
/**
* @param element
* @param string
* {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
* object.
*/
- public NumberWithLabelElement createNumberTextWithLabelElement(
+ public FloatWithLabelElement createFloatTextWithLabelElement(
ICdmFormElement parentElement, String labelString,
Number initialNumber, int style) {
- NumberWithLabelElement element = new NumberWithLabelElement(this,
+ FloatWithLabelElement element = new FloatWithLabelElement(this,
parentElement, labelString, initialNumber, style);
adapt(element);
parentElement.addElement(element);
return element;
}
+ public BigDecimalWithLabelElement createBigDecimalTextWithLabelElement(
+ ICdmFormElement parentElement, String labelString,
+ Number initialNumber, int style) {
+ BigDecimalWithLabelElement element = new BigDecimalWithLabelElement(this,
+ parentElement, labelString, initialNumber, style);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
public LanguageStringWithLabelElement createLanguageStringWithLabelElement(ICdmFormElement parentElement,
String labelString, LanguageString languageString, int style) {
return createLanguageStringWithLabelElement(parentElement, labelString, languageString, null, false, style);
int style) {
return this.createDefinedTermComboElement(termType, null, null, parentElement, labelString, selection, true, style, false, null);
}
+ public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElementDto(
+ TermType termType,
+ ICdmFormElement parentElement,
+ String labelString,
+ TermDto selection,
+ int style) {
+ return this.createDefinedTermComboElement(termType, null, null, parentElement, labelString, selection, true, style, false, null);
+ }
public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
List<T> terms,
}
}
+ private <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
+ TermType termType,
+ TermVocabulary<?> termVocabulary,
+ List<T> terms,
+ ICdmFormElement parentElement,
+ String labelString,
+ TermDto selection,
+ boolean addEmptyElement,
+ int style,
+ boolean useAbbrevLabel,
+ Comparator<T> comparator) {
+ if(termType!=null){
+ TermComboElement<T> element = new TermComboElement<T>(this, parentElement, termType, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
+ else {
+ //this should never happen
+ return null;
+ }
+ }
+
public NameRelationshipTypeCombo createNameRelationshipTypeCombo(ICdmFormElement parentElement,
String labelString,
int style,
public <T extends IEnumTerm<T>> EnumComboElement<T> createEnumComboElement(
Class<T> enumComboType, ICdmFormElement parentElement,
- int style) {
- return createEnumComboElement(enumComboType, parentElement, null, style);
+ int style, boolean hasNullValue) {
+ return createEnumComboElement(enumComboType, parentElement, null, style, hasNullValue);
}
+ public <T extends IEnumTerm<T>> EnumComboElement<T> createEnumComboElement(
+ Class<T> enumComboType, ICdmFormElement parentElement,
+ int style) {
+ return createEnumComboElement(enumComboType, parentElement, null, style, false);
+ }
public <T extends IEnumTerm<T>> EnumComboElement<T> createEnumComboElement(
Class<T> enumComboType, ICdmFormElement parentElement, Comparator<T> comparator,
- int style) {
- EnumComboElement<T> element = new EnumComboElement<T>(this, parentElement, enumComboType, comparator, style);
+ int style, boolean hasNullValue) {
+ EnumComboElement<T> element = new EnumComboElement<T>(this, parentElement, enumComboType, comparator, style, hasNullValue);
adapt(element);
parentElement.addElement(element);
return element;
return element;
}
+ public <TERM extends DefinedTermBase<TERM>, VOC extends TermVocabulary<TERM>> VocabularyComboElement<TERM, VOC> createVocabularyDtoComboElement(
+ TermType termType, String label, TermVocabularyDto selection, ICdmFormElement parentElement, int style) {
+ VocabularyComboElement<TERM, VOC> element = new VocabularyComboElement<TERM, VOC>(this, parentElement, termType, label, selection, style);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
/**
* <p>
* createBrowserElement
return element;
}
+ public PartialElement createPartialElement(ICdmFormElement parentElement, String labelString, Partial partial, boolean showYear,
+ int style) {
+ PartialElement element = new PartialElement(this, parentElement, labelString, style, showYear);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
/**
* <p>
* addSelectionListener
}
+ public DerivedUnitMediaSection createDerivedUnitMediaSection(ConversationHolder conversation,
+ ICdmFormElement parentElement, int style) {
+ DerivedUnitMediaSection section = new DerivedUnitMediaSection(this, conversation, parentElement, style);
+ parentElement.addElement(section);
+ adapt(section);
+ return section;
+
+ }
+
/**
* @param definedTermClass
* @param formElement
return section;
}
+ public CharacterNodeDtoDetailSection createCharacterNodeDtoDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+ CharacterNodeDtoDetailSection section = new CharacterNodeDtoDetailSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public CharacterDetailSection createCharacterDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
CharacterDetailSection section = new CharacterDetailSection(this, conversation, parentElement, selectionProvider, style);
addAndAdaptSection(parentElement, section);
return section;
}
+ public CharacterDtoDetailSection createCharacterDtoDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+ CharacterDtoDetailSection section = new CharacterDtoDetailSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public CharacterNodeDetailElement createCharacterNodeDetailElement(ICdmFormElement parentElement, int style){
CharacterNodeDetailElement element = new CharacterNodeDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
return element;
}
+ public CharacterNodeDtoDetailElement createCharacterNodeDtoDetailElement(ICdmFormElement parentElement, int style){
+ CharacterNodeDtoDetailElement element = new CharacterNodeDtoDetailElement(this, parentElement);
+ addAndAdaptElement(parentElement, element);
+ return element;
+ }
public CharacterDetailElement createCharacterDetailElement(ICdmFormElement parentElement, int style){
CharacterDetailElement element = new CharacterDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
return element;
}
+ public CharacterDtoDetailElement createCharacterDtoDetailElement(ICdmFormElement parentElement, int style){
+ CharacterDtoDetailElement element = new CharacterDtoDetailElement(this, parentElement);
+ addAndAdaptElement(parentElement, element);
+ return element;
+ }
public FeatureTreeDetailElement createFeatureTreeDetailElement(ICdmFormElement parentElement, int style){
FeatureTreeDetailElement element = new FeatureTreeDetailElement(this, parentElement);
return element;
}
+ /**
+ * @param parentElement
+ * @param style
+ * @return
+ */
+ public AbstractCdmDetailElement<TermTree> createFeatureTreeDetailElementForTree(
+ AbstractCdmDetailSection<TermTree> parentElement, int style) {
+ FeatureTreeDetailElementForNode element = new FeatureTreeDetailElementForNode(this, parentElement);
+ addAndAdaptElement(parentElement, element);
+ return element;
+ }
+
public FeatureNodeDetailElement createFeatureNodeDetailElement(ICdmFormElement parentElement, int style){
FeatureNodeDetailElement element = new FeatureNodeDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
addAndAdaptSection(parentElement, section);
return section;
}
+ public FeatureTreeDetailSectionForNode createFeatureTreeDetailSectionForTree(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+ FeatureTreeDetailSectionForNode section = new FeatureTreeDetailSectionForNode(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
public ReferenceDetailSection createReferenceDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
ReferenceDetailSection section = new ReferenceDetailSection(this, conversation, parentElement, selectionProvider, style);
return section;
}
+ public OriginalSourceAdvancedSection createOriginalSourceAdvancedSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+ OriginalSourceAdvancedSection section = new OriginalSourceAdvancedSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
+ public AdvancedSourceElement createAdvancedSourceDetailElement(ICdmFormElement parentElement, int style){
+ AdvancedSourceElement element = new AdvancedSourceElement(this, parentElement);
+ addAndAdaptElement(parentElement, element);
+ return element;
+ }
+
+ public AdvancedSourceElement createAdvancedNomenclaturalSourceDetailElement(ICdmFormElement parentElement, int style){
+ AdvancedNomenclaturalSourceElement element = new AdvancedNomenclaturalSourceElement(this, parentElement);
+ addAndAdaptElement(parentElement, element);
+ return element;
+ }
+
+ public SingleSourceSection createSingleSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, CdmBase cdmEntity, ISelectionProvider selectionProvider, String label, int style){
+ SingleSourceSection section = new SingleSourceSection(this, conversation, parentElement, cdmEntity, selectionProvider, style, label);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public TaxonBaseDetailSection createTaxonBaseDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
TaxonBaseDetailSection section = new TaxonBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
addAndAdaptSection(parentElement, section);
addAndAdaptElement(parentElement, element);
return element;
}
+ public OriginalSourceElement createOriginalSourceElement(ICdmFormElement parentElement, CdmBase cdmEntity, String label){
+ OriginalSourceElement element = new OriginalSourceElement(this, parentElement, cdmEntity, label);
+ addAndAdaptElement(parentElement, element);
+ return element;
+ }
+
+
+ public NomenclaturalSourceElement createNomenclaturalSourceElement(ICdmFormElement parentElement, CdmBase cdmEntity, String label){
+ NomenclaturalSourceElement element = new NomenclaturalSourceElement(this, parentElement, cdmEntity, label);
+ addAndAdaptElement(parentElement, element);
+ return element;
+ }
public TaxonRelationshipDetailElement createTaxonRelationshipDetailElement(ICdmFormElement parentElement){
TaxonRelationshipDetailElement element = new TaxonRelationshipDetailElement(this, parentElement);
return section;
}
+ public InapplicableIfEntityCollectionSectionForNode createInapplicableIfEntityCollectionSectionForNode(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ InapplicableIfEntityCollectionSectionForNode section = new InapplicableIfEntityCollectionSectionForNode(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
+ public OnlyApplicableIfEntityCollectionSectionForNode createOnlyApplicableIfEntityCollectionSectionForNode(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ OnlyApplicableIfEntityCollectionSectionForNode section = new OnlyApplicableIfEntityCollectionSectionForNode(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public AnnotationSection createAnnotationSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
AnnotationSection section = new AnnotationSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
addAndAdaptSection(parentElement, section);
return section;
}
-
public DescriptionElementSourceSection createDescriptionElementSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
DescriptionElementSourceSection section = new DescriptionElementSourceSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
return section;
}
+ public DescriptionElementSourceSection createDescriptionElementSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, Reference defaultSource, int style){
+ DescriptionElementSourceSection section = new DescriptionElementSourceSection(this, conversation, parentElement, defaultSource, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
public ExtensionSection createExtensionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
ExtensionSection section = new ExtensionSection(this, conversation, parentElement, style);
return section;
}
- public ProtologueSection createProtologueSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
- ProtologueSection section = new ProtologueSection(this, conversation, parentElement, style);
+// public ProtologueSection createProtologueSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+// ProtologueSection section = new ProtologueSection(this, conversation, parentElement, style);
+// addAndAdaptSection(parentElement, section);
+// return section;
+// }
+ public ExternalLinksSection createExternalLinksSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ ExternalLinksSection section = new ExternalLinksSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
return section;
}
- public ExternalLinksSection createExternalLinksSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
- ExternalLinksSection section = new ExternalLinksSection(this, conversation, parentElement, style);
+
+ public ExternalLinksSection createExternalLinksSection(ConversationHolder conversation, ICdmFormElement parentElement, String label, int style){
+ ExternalLinksSection section = new ExternalLinksSection(this, conversation, parentElement, label, style);
addAndAdaptSection(parentElement, section);
return section;
}
public RightsSection createRightsSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
RightsSection section = new RightsSection(this, conversation, parentElement, style);
+
addAndAdaptSection(parentElement, section);
return section;
}
return section;
}
+ public StateVocabularyDtoCollectionSection createStateVocabulariesDtoSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ StateVocabularyDtoCollectionSection section = new StateVocabularyDtoCollectionSection(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public RecommendedModifierVocabulariesCollectionSection createRecommendedModifierVocabulariesCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
RecommendedModifierVocabulariesCollectionSection section = new RecommendedModifierVocabulariesCollectionSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
return section;
}
+ public RecommendedModifierVocabulariesDtoCollectionSection createRecommendedModifierVocabulariesDtoCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ RecommendedModifierVocabulariesDtoCollectionSection section = new RecommendedModifierVocabulariesDtoCollectionSection(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
public MeasurementUnitCollectionSection createMeasurementUnitCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
MeasurementUnitCollectionSection section = new MeasurementUnitCollectionSection(this, conversation, parentElement, style);
return section;
}
+ public MeasurementUnitDtoCollectionSection createMeasurementUnitDtoCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ MeasurementUnitDtoCollectionSection section = new MeasurementUnitDtoCollectionSection(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
public StatisticalMeasureCollectionSection createStatisticalMeasureCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
StatisticalMeasureCollectionSection section = new StatisticalMeasureCollectionSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
return section;
}
+ public StatisticalMeasureDtoCollectionSection createStatisticalMeasureDtoCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ StatisticalMeasureDtoCollectionSection section = new StatisticalMeasureDtoCollectionSection(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public CollectingAreasDetailSection createCollectingAreasDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
CollectingAreasDetailSection section = new CollectingAreasDetailSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
} else if (entity instanceof DescriptionElementSource && parentElement.getEntity() instanceof CommonTaxonName) {
element = new CommonNameSourceElement(this, parentElement, (DescriptionElementSource) entity,
removeListener, style);
+ } else if (entity instanceof DescriptionElementSource && parentElement.getEntity() instanceof Distribution) {
+ Composite parent = null;
+ if (parentElement instanceof DescriptionElementSourceSection){
+ parent = ((DescriptionElementSourceSection)parentElement).getParent();
+ }
+ element = new DescriptionElementSourceElement(this, parentElement, (DescriptionElementSource) entity,
+ removeListener, style, false);
} else if (entity instanceof DescriptionElementSource) {
element = new DescriptionElementSourceElement(this, parentElement, (DescriptionElementSource) entity,
removeListener, style, false);
- } else if (entity instanceof TaxonNodeAgentRelation) {
+ }else if (entity instanceof TaxonNodeAgentRelation) {
element = new TaxonNodeAgentRelationCollectionElement(this, parentElement, (TaxonNodeAgentRelation) entity,
removeListener,backgroundColor, style);
- }
- else if (entity instanceof IdentifiableSource) {
+ }else if (entity instanceof IdentifiableSource && parentElement.getEntity() instanceof DescriptionElementBase) {
element = new IdentifiableSourceElement(this, parentElement, (IdentifiableSource) entity, removeListener,
- style);
+ style, false);
+ } else if (entity instanceof IdentifiableSource ) {
+ element = new IdentifiableSourceElement(this, parentElement, (IdentifiableSource) entity, removeListener,
+ style, true);
} else if (entity instanceof DefinedTerm) {
switch(((DefinedTerm)entity).getTermType()) {
case Scope:
// this is the special case for protologs, maybe we can do this
// differently when API improves
DescriptionElementBase descriptionElement = (DescriptionElementBase) entity;
- if (descriptionElement.getFeature().equals(Feature.PROTOLOGUE())) {
- element = new ProtologueElement(this, parentElement, descriptionElement, removeListener, style);
- }
+// if (descriptionElement.getFeature().equals(Feature.PROTOLOGUE())) {
+// element = new ProtologueElement(this, parentElement, descriptionElement, removeListener, style);
+// }
} else if (entity instanceof Identifier) {
if(parentElement instanceof AbstractSampleDesignationDetailSection){
element = new SampleDesignationTextDetailElement(this, parentElement, (Identifier<DnaSample>) entity, removeListener, backgroundColor, style);
default:
break;
}
- } else if (entity instanceof MeasurementUnit) {
+ }else if (entity instanceof TermVocabularyDto) {
+ TermVocabularyDto termVocabulary = (TermVocabularyDto)entity;
+ switch (termVocabulary.getTermType()) {
+ case State:
+ element = new StateVocabularyDtoCollectionElement(this, parentElement, termVocabulary, removeListener, backgroundColor, style);
+ break;
+ case Modifier:
+ element = new RecommendedModifierDtoVocabulariesElement(this, parentElement, termVocabulary, removeListener, backgroundColor, style);
+ break;
+ default:
+ break;
+ }
+ }else if (entity instanceof MeasurementUnit) {
element = new MeasurementUnitCollectionElement(this, parentElement, (MeasurementUnit) entity, removeListener, backgroundColor, style);
- } else if (entity instanceof StatisticalMeasure) {
+ }else if (entity instanceof TermDto) {
+ if(((TermDto)entity).getTermType().equals(TermType.MeasurementUnit)){
+ element = new MeasurementUnitDtoCollectionElement(this, parentElement, (TermDto) entity, removeListener, backgroundColor, style);
+ }else if (((TermDto)entity).getTermType().equals(TermType.StatisticalMeasure)){
+ element = new StatisticalMeasureDtoCollectionElement(this, parentElement, (TermDto) entity, removeListener, backgroundColor, style);
+ }
+ }else if (entity instanceof StatisticalMeasure) {
element = new StatisticalMeasureCollectionElement(this, parentElement, (StatisticalMeasure) entity, removeListener, backgroundColor, style);
} else if (entity instanceof FeatureState && parentElement instanceof InapplicableIfEntityCollectionSection) {
element = new InapplicableIfCollectionElement(this, parentElement, (FeatureState) entity, removeListener, backgroundColor, style);
* a {@link ConversationHolder} object.
* @return a {@link EntitySelectionElement} object.
*/
+ public <T extends CdmBase> EntitySelectionElement<T> createSelectionElement(Class<T> clazz,
+ ICdmFormElement parentElement, String labelString, T selection, int mode,
+ int style, Integer limit) {
+ EntitySelectionElement<T> element = new EntitySelectionElement<T>(this,
+ parentElement, clazz,
+ labelString, selection, mode, style, limit);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
public <T extends CdmBase> EntitySelectionElement<T> createSelectionElement(Class<T> clazz,
ICdmFormElement parentElement, String labelString, T selection, int mode,
int style, boolean filterElement) {
public TaxonNodeSelectionElement createTaxonNodeSelectionElement(ConversationHolder conversation,
ICdmFormElement parentElement, String labelString, TaxonNode selection, int mode, int style) {
+ TaxonNodeSelectionElement element = new TaxonNodeSelectionElement(this,
+ parentElement,
+ labelString, selection, mode, style, null);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+ public TaxonNodeSelectionElement createTaxonNodeSelectionElement(ConversationHolder conversation,
+ ICdmFormElement parentElement, String labelString, TaxonNode selection, int mode, int style, Integer limit) {
TaxonNodeSelectionElement element = new TaxonNodeSelectionElement(this, //conversation,
parentElement,
- labelString, selection, mode, style);
+ labelString, selection, mode, style, limit);
adapt(element);
parentElement.addElement(element);
return element;
}
-
// public NomenclaturalAuthorTeamSelectionElement createNomenclaturalAuthorTeamSelectionElement(
// ConversationHolder conversation, ICdmFormElement parentElement, String labelString, Team selection,
// int mode, int style) {
} else if (entity instanceof TaxonInteraction) {
detailedDescriptionElement = new TaxonInteractionDetailElement(this, parentElement,
(TaxonInteraction) entity, style);
+ } else if (entity instanceof TemporalData) {
+ detailedDescriptionElement = new TemporalDataDetailElement(this, parentElement, (TemporalData) entity, style);
} else if (entity instanceof TextData) {
detailedDescriptionElement = new TextDataDetailElement(this, parentElement, (TextData) entity, style);
- } else {
+ }
+ else {
throw new IllegalStateException("There is no interface for the given description element");
}
adapt(detailedDescriptionElement);
}
+ /**
+ * <p>
+ * createTextWithLabelElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param initialText
+ * a {@link java.lang.String} object.
+ * @param textLimit maximal number of characters allowed
+ * @param style
+ * a int.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
+ * object.
+ */
+ public RuleConsideredElement createRuleConsideredElement(ICdmFormElement parentElement, String labelString, boolean isShowCodeEdition, int style) {
+ RuleConsideredElement element = new RuleConsideredElement(this, parentElement, labelString, isShowCodeEdition, style);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
+ /**
+ * @param class1
+ * @param formElement
+ * @param string
+ * @param area
+ * @param nothing
+ * @param style
+ * @return
+ */
+ public EntitySelectionElementWithIdInVocabulary createSelectionElementWithIdInVocabulary(Class<NamedArea> clazz,
+ ICdmFormElement formElement, String labelString, NamedArea area, int mode, int style) {
+ EntitySelectionElementWithIdInVocabulary element = new EntitySelectionElementWithIdInVocabulary(this,
+ formElement, clazz, labelString, area, mode, style);
+ adapt(element);
+ formElement.addElement(element);
+ return element;
+ }
+
+ /**
+ * @param extendedTimePeriodElement
+ * @param twistie
+ * @return
+ */
+ public ExtendedTimeDetailSection createExtendedTimeDetailSection(
+ ExtendedTimePeriodElement parentElement, int style) {
+ ExtendedTimeDetailSection section = new ExtendedTimeDetailSection(this, parentElement, style);
+ parentElement.addElement(section);
+ adapt(section);
+ return section;
+ }
+ public ExtendedTimePeriodElement createExtendedTimePeriodElement(
+ ICdmFormElement parentElement, String labelString, ExtendedTimePeriod timePeriod, int style) {
+ ExtendedTimePeriodElement section = new ExtendedTimePeriodElement(this, parentElement, labelString, timePeriod, style);
+ parentElement.addElement(section);
+ adapt(section);
+ return section;
+ }
+