eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SourceCollectionDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SpecimenCollectionDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SpecimenCollectionDetailSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenAbstractDeterminationEventDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenCurrentDeterminationDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDetailElement.java -text
import eu.etaxonomy.taxeditor.ui.section.occurrence.SourceCollectionDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenCollectionDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenCollectionDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenCurrentDeterminationDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenDetailSection;
return section;
}
+ public TaxonAssociationDetailSection createTaxonAssociationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+ TaxonAssociationDetailSection section = new TaxonAssociationDetailSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public OriginalLabelDataSection createOriginalLabelDataSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
OriginalLabelDataSection section = new OriginalLabelDataSection(this, conversation, parentElement, selectionProvider, style);
addAndAdaptSection(parentElement, section);
return element;
}
+ public TaxonAssociationDetailElement createTaxonAssociationDetailElement(ICdmFormElement parentElement){
+ TaxonAssociationDetailElement element = new TaxonAssociationDetailElement(this, parentElement);
+ addAndAdaptElement(parentElement, element);
+ return element;
+ }
+
public PreservedSpecimenGeneralDetailElement createPreservedSpecimenGeneralDetailElement(ICdmFormElement parentElement){
PreservedSpecimenGeneralDetailElement element = new PreservedSpecimenGeneralDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.ui.section.occurrence.association;
+
+import java.util.Collection;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.NotEnabledException;
+import org.eclipse.core.commands.NotHandledException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.handlers.IHandlerService;
+
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+
+/**
+ * @author pplitzner
+ * @date Dec 1, 2014
+ *
+ */
+public class TaxonAssociationDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> implements IDoubleClickListener{
+
+
+ public TaxonAssociationDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
+ super(formFactory, formElement);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+
+ Label associationsLabel = formFactory.createLabel(getLayoutComposite(), "Individuals Associations");
+ associationsLabel.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+
+ TableViewer associationsViewer = new TableViewer(getLayoutComposite(), SWT.FULL_SELECTION);
+ associationsViewer.getTable().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ associationsViewer.setContentProvider(new ArrayContentProvider());
+ Collection<TaxonBase<?>> associatedTaxa = CdmStore.getService(IOccurrenceService.class).listAssociatedTaxa(entity.innerDerivedUnit(), null, null, null, null);
+ associationsViewer.setInput(associatedTaxa);
+ associationsViewer.addDoubleClickListener(this);
+
+ Label typeLabel = formFactory.createLabel(getLayoutComposite(), "Type Designations");
+ typeLabel.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+
+ TableViewer typeDesignationViewer = new TableViewer(getLayoutComposite(), SWT.FULL_SELECTION);
+ typeDesignationViewer.getTable().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ typeDesignationViewer.setContentProvider(new ArrayContentProvider());
+ Collection<TaxonBase<?>> typedTaxa = CdmStore.getService(IOccurrenceService.class).listTypedTaxa(entity.innerDerivedUnit(), null, null, null, null);
+ typeDesignationViewer.setInput(typedTaxa);
+ typeDesignationViewer.addDoubleClickListener(this);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void handleEvent(Object eventSource) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
+ */
+ @Override
+ public void doubleClick(DoubleClickEvent event) {
+ String commandId = "eu.etaxonomy.taxeditor.navigation.command.update.editSelection";
+
+ IHandlerService handlerService = (IHandlerService) AbstractUtility.getService(IHandlerService.class);
+ try {
+ handlerService.executeCommand(commandId, null);
+ } catch (ExecutionException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (NotDefinedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (NotEnabledException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (NotHandledException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+// if(event.getSelection() instanceof StructuredSelection){
+// StructuredSelection selection = (StructuredSelection)event.getSelection();
+// if(selection.getFirstElement() instanceof TaxonBase<?>){
+// UUID taxonBaseUUID = ((TaxonBase<?>) selection.getFirstElement()).getUuid();
+// }
+// }
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* 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.section.occurrence.association;
+
+import org.eclipse.jface.viewers.ISelectionProvider;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.IDerivedUnitFacadeDetailSection;
+
+/**
+ *
+ * @author pplitzner
+ * @date Dec 1, 2014
+ *
+ */
+public class TaxonAssociationDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
+
+ public TaxonAssociationDetailSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement,
+ ISelectionProvider selectionProvider, int style) {
+ super(formFactory, conversation, parentElement, selectionProvider, style);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public String getHeading() {
+ return "Taxon Associations";
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+ */
+ @Override
+ protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
+ return formFactory.createTaxonAssociationDetailElement(parentElement);
+ }
+}
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.OriginalLabelDataSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationCloningDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationGelPhotoCollectionDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationGeneralDetailSection;
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ addPart(derivedUnitBaseDetailSection);
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
OriginalLabelDataSection originalLabelDataSection = formFactory.createOriginalLabelDataSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
addPart(originalLabelDataSection);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(derivedUnitBaseDetailSection);
-
+ TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ addPart(taxonAssociationDetailSection);
}
else{
DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);