/**
- *
- */
+* 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.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
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.DefinedTerm;
-import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.ExtendedTimePeriod;
import eu.etaxonomy.cdm.model.common.Extension;
-import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
-import eu.etaxonomy.cdm.model.common.Group;
import eu.etaxonomy.cdm.model.common.ICdmBase;
-import eu.etaxonomy.cdm.model.common.IEnumTerm;
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
import eu.etaxonomy.cdm.model.common.Identifier;
import eu.etaxonomy.cdm.model.common.LSID;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.common.Marker;
-import eu.etaxonomy.cdm.model.common.Representation;
-import eu.etaxonomy.cdm.model.common.TermBase;
-import eu.etaxonomy.cdm.model.common.TermType;
-import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.common.TimePeriod;
-import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.cdm.model.common.VerbatimTimePeriod;
import eu.etaxonomy.cdm.model.common.VersionableEntity;
import eu.etaxonomy.cdm.model.description.CategoricalData;
import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
import eu.etaxonomy.cdm.model.description.Distribution;
import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.FeatureState;
import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
import eu.etaxonomy.cdm.model.description.KeyStatement;
import eu.etaxonomy.cdm.model.description.MeasurementUnit;
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.media.Rights;
import eu.etaxonomy.cdm.model.molecular.DnaSample;
import eu.etaxonomy.cdm.model.name.NameRelationship;
+import eu.etaxonomy.cdm.model.name.NameRelationshipType;
import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
+import eu.etaxonomy.cdm.model.name.TextualTypeDesignation;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
+import eu.etaxonomy.cdm.model.permission.GrantedAuthorityImpl;
+import eu.etaxonomy.cdm.model.permission.Group;
+import eu.etaxonomy.cdm.model.permission.User;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+import eu.etaxonomy.cdm.model.term.DefinedTerm;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+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.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
+import eu.etaxonomy.taxeditor.ui.combo.InverseTermWrapper;
import eu.etaxonomy.taxeditor.ui.combo.MisappliedRelationshipComboElement;
-import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
+import eu.etaxonomy.taxeditor.ui.combo.NameRelationshipTypeCombo;
import eu.etaxonomy.taxeditor.ui.combo.VocabularyComboElement;
+import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
import eu.etaxonomy.taxeditor.ui.dialog.CloneClassificationDetailElement;
import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection.UnitType;
import eu.etaxonomy.taxeditor.ui.mvc.element.DateElement;
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.CollectingAreaDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.CollectingAreasDetailSection;
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
* object.
*/
public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator) {
+ if(selectionArbitrator==null){
+ return;
+ }
removeSelectionListener(selectionArbitrator);
if (selectionProvider != null) {
selectionProvider.removeSelectionChangedListener(selectionArbitrator);
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}
* object.
*
* @param Representation
- * a {@link eu.etaxonomy.cdm.model.common.Representation} object.
+ * a {@link eu.etaxonomy.cdm.model.term.Representation} object.
* @param textHeight
* a int.
* @param style
}
/**
- * <p>
* createMultiLanguageTextElement
- * </p>
*
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
*
* @param Representation
- * a {@link eu.etaxonomy.cdm.model.common.Representation} object.
+ * a {@link eu.etaxonomy.cdm.model.term.Representation} object.
* @param textHeight
* a int.
* @param style
return element;
}
- /**
- * <p>
- * createMultiLanguageTextElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- *
- * @param term
- * a {@link eu.etaxonomy.cdm.model.common.Representation} object.
- * @param textHeight
- * a int.
- * @param style
- * a int.
- * @return a
- * {@link eu.etaxonomy.taxeditor.ui.element.RepresentationElement}
- * object.
- */
- public RepresentationElement createRepresentationElement(ICdmFormElement parentElement, TermBase term, int textHeight, int style, boolean fillDetails) {
- RepresentationElement element = new RepresentationElement(this, parentElement, term, textHeight, style, fillDetails);
+ 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;
}
- /**
- * <p>
- * createMultiLanguageTextElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- *
- * @param term
- * a {@link eu.etaxonomy.cdm.model.common.Representation} object.
- * @param textHeight
- * a int.
- * @param style
- * a int.
- * @return a
- * {@link eu.etaxonomy.taxeditor.ui.element.RepresentationElement}
- * object.
- */
- public TranslatableRepresentationElement createTranslatableRepresentationElement(ICdmFormElement parentElement, TermBase term, int textHeight, int style, boolean fillDetails) {
- TranslatableRepresentationElement element = new TranslatableRepresentationElement(this, parentElement, term, textHeight, style, fillDetails);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
public KeyStatementElement createKeyStatementElement(ICdmFormElement parentElement, String labelString,
KeyStatement keyStatement, int textHeight, int style) {
String initialText, int style) {
return createTextWithLabelElement(parentElement, labelString, initialText, null, style);
}
+
/**
- * <p>
* createTextWithLabelElement
- * </p>
*
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
}
+ public DoiWithLabelElement createDoiWithLabelElement(ICdmFormElement parentElement, String labelString,
+ DOI initialDoi, int style) {
+ DoiWithLabelElement element = new DoiWithLabelElement(this, parentElement, labelString, initialDoi, null, style);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+ public DoiWithLabelElement createDoiWithLabelElement(ICdmFormElement parentElement, String labelString,
+ DOI initialDoi,Integer textHeight, int style) {
+ DoiWithLabelElement element = new DoiWithLabelElement(this, parentElement, labelString, initialDoi, textHeight, style);
+ adapt(element);
+ parentElement.addElement(element);
+ 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);
T selection,
int style,
Comparator<T> comparator) {
- return this.createDefinedTermComboElement(termType, null, parentElement, labelString, selection, true, style, false, comparator);
+ return this.createDefinedTermComboElement(termType, null, null, parentElement, labelString, selection, true, style, false, comparator);
}
public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
T selection,
boolean addEmptyElement,
int style) {
- return this.createDefinedTermComboElement(termType, null, parentElement, labelString, selection, addEmptyElement, style, false, null);
+ return this.createDefinedTermComboElement(termType, null, null, parentElement, labelString, selection, addEmptyElement, style, false, null);
}
public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
String labelString,
T selection,
int style) {
- return this.createDefinedTermComboElement(termType, null, parentElement, labelString, selection, true, style, false, null);
+ 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,
+ ICdmFormElement parentElement,
+ String labelString,
+ T selection,
+ int style) {
+ return this.createDefinedTermComboElement(null, null, terms, parentElement, labelString, selection, true, style, false, null);
+ }
+ public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
+ List<T> terms,
+ ICdmFormElement parentElement,
+ String labelString,
+ T selection,
+ boolean addEmptyElement,
+ int style) {
+ return this.createDefinedTermComboElement(null, null, terms, parentElement, labelString, selection, addEmptyElement, style, false, null);
}
public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
TermType termType,
boolean addEmptyElement,
int style,
boolean useAbbrevLabel) {
- return createDefinedTermComboElement(termType, null, parentElement, labelString, selection, addEmptyElement, style, useAbbrevLabel, null);
+ return createDefinedTermComboElement(termType, null, null, parentElement, labelString, selection, addEmptyElement, style, useAbbrevLabel, null);
}
String labelString,
T selection,
int style) {
- return this.createDefinedTermComboElement(null, termVocabulary, parentElement, labelString, selection, true, style, false, null);
+ return this.createDefinedTermComboElement(null, termVocabulary, null, parentElement, labelString, selection, true, style, false, null);
}
public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
boolean addEmptyElement,
int style,
boolean useAbbrevLabel) {
- return createDefinedTermComboElement(null, termVocabulary, parentElement, labelString, selection, addEmptyElement, style, useAbbrevLabel, null);
+ return createDefinedTermComboElement(null, termVocabulary, null, parentElement, labelString, selection, addEmptyElement, style, useAbbrevLabel, null);
}
private <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
TermType termType,
TermVocabulary<?> termVocabulary,
+ List<T> terms,
ICdmFormElement parentElement,
String labelString,
T selection,
adapt(element);
parentElement.addElement(element);
return element;
+ }else if (terms != null){
+
+ TermComboElement<T> element = new TermComboElement<T>(this, parentElement, terms, labelString, selection, addEmptyElement, style, useAbbrevLabel);
+ if (comparator!= null){
+ element.setTermComparator(comparator);
+ }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
}
- else{
+ else {
//this should never happen
return null;
}
}
+
+ 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,
+ boolean useAbbrevLabel,
+ Comparator<NameRelationshipType> comparator) {
+
+ NameRelationshipTypeCombo<InverseTermWrapper> element = new NameRelationshipTypeCombo(this, parentElement, labelString, true, style, useAbbrevLabel, comparator);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
public MisappliedRelationshipComboElement createMisappliedRelationshipComboElement(
ICdmFormElement parentElement,
String labelString,
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
section.addFocusListener(selectionFocusHandler);
section.setPropertyChangeListeners(propertyChangeListeners);
+ section.addExpansionListener(new ExpansionAdapter(){
+ @Override
+ public void expansionStateChanged(ExpansionEvent e) {
+ super.expansionStateChanged(e);
+ if(section.getEntity()!=null){
+ PreferencesUtil.setStringValue(StoreUtil.getPrefKey(section.getClass(), section.getEntity().getClass().getCanonicalName()), e.getState()?CdmSectionPart.EXPANDED:CdmSectionPart.COLLAPSED);
+ }
+ }
+ });
+
if (section.getToggle() != null) {
section.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors.TB_TOGGLE_HOVER));
section.getToggle().setDecorationColor(getColors().getColor(IFormColors.TB_TOGGLE));
return element;
}
+
+
/**
* <p>
* createGatheringEventUnitElement
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
return element;
}
- public AbstractFormSection createDefinedTermDetailSection(Class definedTermClass, ConversationHolder conversation,
+ public DefinedTermDetailSection createDefinedTermDetailSection(Class definedTermClass, ConversationHolder conversation,
ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
- AbstractFormSection section = new DefinedTermDetailSection(this, definedTermClass, conversation, parentElement,
+ DefinedTermDetailSection section = new DefinedTermDetailSection(this, definedTermClass, conversation, parentElement,
selectionProvider, style);
parentElement.addElement(section);
}
+ public TermMediaSection createTermMediaSection(ConversationHolder conversation,
+ ICdmFormElement parentElement, int style) {
+ TermMediaSection section = new TermMediaSection(this, conversation, parentElement, style);
+ parentElement.addElement(section);
+ adapt(section);
+ return section;
+
+ }
+
+ 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 element;
}
+ public CharacterNodeDetailSection createCharacterNodeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+ CharacterNodeDetailSection section = new CharacterNodeDetailSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ 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:
} else if (entity instanceof NameTypeDesignation) {
element = new NameTypeDesignationElement(this, parentElement, (NameTypeDesignation) entity, removeListener,
style);
+ } else if (entity instanceof TextualTypeDesignation) {
+ element = new TextTypeDesignationElement(this, parentElement, (TextualTypeDesignation) entity, removeListener,
+ style);
} else if (entity instanceof NameRelationship) {
element = new NameRelationshipDetailElement(this, parentElement, (NameRelationship) entity, removeListener,
style);
// 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 State && parentElement instanceof InapplicableIfEntityCollectionSection) {
- element = new InapplicableIfCollectionElement(this, parentElement, (State) entity, removeListener, backgroundColor, style);
- } else if (entity instanceof State && parentElement instanceof OnlyApplicableIfEntityCollectionSection) {
- element = new OnlyApplicableIfCollectionElement(this, parentElement, (State) entity, removeListener, backgroundColor, style);
+ } else if (entity instanceof FeatureState && parentElement instanceof InapplicableIfEntityCollectionSection) {
+ element = new InapplicableIfCollectionElement(this, parentElement, (FeatureState) entity, removeListener, backgroundColor, style);
+ } else if (entity instanceof FeatureState && parentElement instanceof OnlyApplicableIfEntityCollectionSection) {
+ element = new OnlyApplicableIfCollectionElement(this, parentElement, (FeatureState) entity, removeListener, backgroundColor, style);
}
//check for parent section when entity is null
* @return a {@link EntitySelectionElement} object.
*/
public <T extends CdmBase> EntitySelectionElement<T> createSelectionElement(Class<T> clazz,
- ConversationHolder conversation, ICdmFormElement parentElement, String labelString, T selection, int mode,
+ 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) {
EntitySelectionElement<T> element = new EntitySelectionElement<T>(this, //conversation,
parentElement, clazz,
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;
+ }
+