public AbstractEntityCollectionElement createEntityCollectionElement(AbstractFormSection parentElement,
Object versionableEntity, SelectionListener removeListener, Color backgroundColor, int style) {
- AbstractEntityCollectionElement element = null;
+ AbstractEntityCollectionElement<?> element = null;
Object entity = HibernateProxyHelper.deproxy(versionableEntity);
private String title;
- private AbstractEntityCollectionElement entityCollectionElement;
+ private AbstractEntityCollectionElement<ENTITY> entityCollectionElement;
public AbstractEntityCollectionSection(CdmFormFactory formFactory, ConversationHolder conversation, ICdmFormElement parentElement, String title, int style) {
super(formFactory, parentElement, ExpandableComposite.CLIENT_INDENT | style);
}
}
- public AbstractEntityCollectionElement getEntityCollectionElement() {
+ public AbstractEntityCollectionElement<ENTITY> getEntityCollectionElement() {
return entityCollectionElement;
}
/**
* @author n.hoffmann
* @created May 11, 2011
- * @version 1.0
*/
public class CurrentDeterminationDetailSection extends
AbstractDeterminationEventDetailSection {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
Action addAction = new Action("add", IAction.AS_PUSH_BUTTON){
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
@Override
public void run() {
DeterminationEvent element = createNewElement();
internalUpdateSection(false);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
- */
@Override
public Collection<DeterminationEvent> getCollection(DerivedUnitFacade entity) {
DeterminationEvent preferredDetermination = entity.getPreferredDetermination();
return new DefaultCdmBaseComparator<>();
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.occurrence.AbstractDeterminationEventDetailSection#createNewElement()
- */
@Override
public DeterminationEvent createNewElement() {
DeterminationEvent newElement = super.createNewElement();
return newElement;
}
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
- */
/** {@inheritDoc} */
@Override
protected String getTooltipString() {
/**
* @author n.hoffmann
* @created May 11, 2011
- * @version 1.0
*/
public class DeterminationHistoryDetailSection extends
AbstractDeterminationEventDetailSection {
super(formFactory, conversation, parentElement, "Determination History", style);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
- */
@Override
public Collection<DeterminationEvent> getCollection(DerivedUnitFacade entity) {
return entity != null ? entity.getOtherDeterminations() : null;
internalUpdateSection(false);
}
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
- */
/** {@inheritDoc} */
@Override
protected String getTooltipString() {
Collection<ELEMENT> elements = getEntityCollection(entity);
if(addUnboundElement){
//cloning to avoid saving the dummy element
- Collection<ELEMENT> clonedElements = new ArrayList<ELEMENT>();
+ Collection<ELEMENT> clonedElements = new ArrayList<>();
clonedElements.addAll(elements);
clonedElements.add(createNewElement()); //add dummy element which is not bound to entity
return clonedElements;
internalUpdateSection(false);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
- */
@Override
public Collection<Identifier> getCollection(IdentifiableEntity<?> entity) {
Identifier currentSampleDesignation = DerivateLabelProvider.getCurrentSampleDesignation(entity);
return new DefaultCdmBaseComparator<>();
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
- */
/** {@inheritDoc} */
@Override
protected String getTooltipString() {
return "Create new current sample designation";
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
- */
/** {@inheritDoc} */
@Override
public void addElement(Identifier sampleDesignation) {
*/
@Override
public Collection<Identifier> getCollection(IdentifiableEntity<?> entity) {
- LinkedList<Identifier> sampleDesignations = new LinkedList<Identifier>();
+ LinkedList<Identifier> sampleDesignations = new LinkedList<>();
for (Identifier identifier : entity.getIdentifiers()) {
if(identifier.getType()!=null && identifier.getType().equals(DerivateLabelProvider.getSampleDesignationTerm())){
sampleDesignations.add(identifier);