import org.eclipse.swt.SWT;
+import eu.etaxonomy.cdm.model.agent.AgentBase;
+import eu.etaxonomy.cdm.model.agent.Institution;
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.SelectionType;
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
-import eu.etaxonomy.taxeditor.ui.selection.AgentSelectionElement;
-import eu.etaxonomy.taxeditor.ui.selection.InstitutionSelectionElement;
-import eu.etaxonomy.taxeditor.ui.selection.ReferenceSelectionElement;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
* <p>
private TextWithLabelElement text_title;
private TextWithLabelElement text_volume;
private UriWithLabelElement text_uri;
- private AgentSelectionElement selection_authorTeam;
+ private EntitySelectionElement<AgentBase> selection_authorTeam;
private TimePeriodElement element_timePeriod;
- private ReferenceSelectionElement selection_inReference;
- private InstitutionSelectionElement selection_institution;
+ private EntitySelectionElement<Reference> selection_inReference;
+ private EntitySelectionElement<Institution> selection_institution;
private EnumComboElement<ReferenceType> combo_referenceType;
- private ReferenceSelectionElement selection_inSeries;
+ private EntitySelectionElement<Reference> selection_inSeries;
/**
* <p>
"Title", entity.getTitle(), style);
// author team
- selection_authorTeam = (AgentSelectionElement) formFactory
- .createSelectionElement(SelectionType.AGENT,
+ selection_authorTeam = formFactory
+ .createSelectionElement(AgentBase.class,
getConversationHolder(), formElement, "Author",
AuthorHelper.getAuthor(entity.getAuthorTeam()),
- AgentSelectionElement.DEFAULT, style);
+ EntitySelectionElement.ALL, style);
ReferenceType referenceType = entity.getType();
}
if (createInReferenceWidget) {
- selection_inReference = (ReferenceSelectionElement) formFactory
- .createSelectionElement(SelectionType.REFERENCE,
+ selection_inReference = formFactory
+ .createSelectionElement(Reference.class,
getConversationHolder(), element, label,
reference.getInReference(),
- ReferenceSelectionElement.DEFAULT, style);
+ EntitySelectionElement.ALL, style);
}
}
if (referenceType.equals(ReferenceType.Report)) {
// institution
- selection_institution = (InstitutionSelectionElement) formFactory
- .createSelectionElement(SelectionType.INSTITUTION,
+ selection_institution = formFactory
+ .createSelectionElement(Institution.class,
getConversationHolder(), element, "Institution",
reference.getInstitution(),
- InstitutionSelectionElement.DEFAULT, style);
+ EntitySelectionElement.ALL, style);
}
if (referenceType.equals(ReferenceType.Thesis)) {
// school
- selection_institution = (InstitutionSelectionElement) formFactory
- .createSelectionElement(SelectionType.INSTITUTION,
+ selection_institution = formFactory
+ .createSelectionElement(Institution.class,
getConversationHolder(), element, "School",
reference.getSchool(),
- InstitutionSelectionElement.DEFAULT, style);
+ EntitySelectionElement.ALL, style);
}
if (referenceType.equals(ReferenceType.Proceedings)) {
private void createPrintedUnitControls(ICdmFormElement element,
ReferenceType referenceType, Reference reference, int style) {
// in series
- selection_inSeries = (ReferenceSelectionElement) formFactory
- .createSelectionElement(SelectionType.REFERENCE,
+ selection_inSeries = formFactory
+ .createSelectionElement(Reference.class,
getConversationHolder(), element, "In Series",
- reference.getInSeries(),
- ReferenceSelectionElement.DEFAULT, style);
+ (Reference) reference.getInSeries(),
+ EntitySelectionElement.ALL, style);
// editor
text_editor = formFactory.createTextWithLabelElement(element, "Editor",