eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsContentProvider.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsLabelProvider.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditor.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditorLineDisplayStrategy.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DerivedUnitEditorInput.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientAgentService.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientCdmRepository.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientClassificationService.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientCollectionService.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientDescriptionService.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientNameService.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientOccurenceService.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientReferenceService.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientTaxonService.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientTermService.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizard.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizardPage.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/test/java/eu/etaxonomy/taxeditor/bulkeditor/Application.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/test/java/eu/etaxonomy/taxeditor/bulkeditor/ApplicationActionBarAdvisor.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/test/java/eu/etaxonomy/taxeditor/bulkeditor/ApplicationWorkbenchAdvisor.java -text
eu.etaxonomy.taxeditor.editor/icons/camera-photo.png -text
eu.etaxonomy.taxeditor.editor/icons/edit_16x16.gif -text
eu.etaxonomy.taxeditor.editor/icons/emblem-photos.png -text
+eu.etaxonomy.taxeditor.editor/icons/leaf_detail.png -text
eu.etaxonomy.taxeditor.editor/icons/xper64.png -text
eu.etaxonomy.taxeditor.editor/p2.inf -text
eu.etaxonomy.taxeditor.editor/plugin.properties -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/handler/OpenRelatedConceptHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/operation/CreateConceptRelationOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/operation/DeleteConceptRelationOperation.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/CreateDerivateContextMenu.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateContentProvider.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateLabelProvider.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateMenuPropertyTester.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptionElementDragListener.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptionElementDropAdapter.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptionElementTransfer.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/TermStore.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/internal/TaxeditorStorePlugin.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/bar/AuthenticatedUserBar.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/ComboDefinedTermController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/EntityCollectionElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/EntitySelectionField.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/EntitySelectionFieldController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/LanguageTextFieldController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/NamedAreaFieldController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/NumberFieldController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/PointField.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/PointFieldController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/TextFieldController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/ToggleableTextField.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/ToggleableTextFieldController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/compatibility/ICdmFormElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/compatibility/IEntitySelectionElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsElementController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationDetailsView.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationGeneralElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationGeneralElementController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/FieldObservationGeneralSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventDetailsElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventDetailsElementController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/DerivedUnitDetailsElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/DerivedUnitDetailsElementController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/DerivedUnitDetailsSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/SpecimenDetailsElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/SpecimenDetailsElementController.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/SpecimenDetailsSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/SpecimenGeneralSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/specimenSearch/SpecimenSearchComposite.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/specimenSearch/SpecimenSearchController.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/EnumComboElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermComboElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/LoginDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CheckboxElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/GatheringEventUnitElement.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/ICdmFormElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/IEnableableFormElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/IEntityElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/IErrorIntolerableElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractEntityCollectionSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractIdentifiableEntityDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/EmptyElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/ICdmDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/ITaxonBaseDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/InstitutionDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/InstitutionDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitDetailsWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationHistoryDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationDetailSection.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationDetailsWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationGeneralWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailSection.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailsWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailSection.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/IDerivedUnitFacadeDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/NamedAreaDetailElement.java -text
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/SpecimenDetailsWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SpecimenGeneralWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/NomenclaturalReferenceDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/NomenclaturalReferenceDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/reporting/ReportingViewPart.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/supplementaldata/SupplementalDataViewPart.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/supplementaldata/SupplementalDataViewer.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/org/eclipse/wb/swt/ResourceManager.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java -text
eu.etaxonomy.taxeditor.store/src/main/resources/eu/etaxonomy/cdm/editorApplicationContext.xml -text
eu.etaxonomy.taxeditor.store/src/main/resources/log4j.properties -text
eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/NameProtectTitleCacheTest.java -text
Bundle-Version: 3.3.0.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin
Bundle-Vendor: EDIT
-Export-Package: eu.etaxonomy.taxeditor.annotatedlineeditor,eu.etaxonomy.taxeditor.annotatedlineeditor.handler,eu.etaxonomy.taxeditor.bulkeditor,eu.etaxonomy.taxeditor.bulkeditor.command,eu.etaxonomy.taxeditor.bulkeditor.handler,eu.etaxonomy.taxeditor.bulkeditor.input,eu.etaxonomy.taxeditor.bulkeditor.internal,eu.etaxonomy.taxeditor.bulkeditor.referencingobjects
+Export-Package: eu.etaxonomy.taxeditor.annotatedlineeditor,
+ eu.etaxonomy.taxeditor.annotatedlineeditor.handler,
+ eu.etaxonomy.taxeditor.bulkeditor,
+ eu.etaxonomy.taxeditor.bulkeditor.command,
+ eu.etaxonomy.taxeditor.bulkeditor.handler,
+ eu.etaxonomy.taxeditor.bulkeditor.input,
+ eu.etaxonomy.taxeditor.bulkeditor.internal,
+ eu.etaxonomy.taxeditor.bulkeditor.referencingobjects,
+ eu.etaxonomy.taxeditor.dataimport,
+ eu.etaxonomy.taxeditor.dataimport.wizard
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ui.editors,
id="nameeditor.editor"\r
name="Name Editor">\r
</editor>\r
+ <editor\r
+ class="eu.etaxonomy.taxeditor.dataimport.DataImportEditor"\r
+ default="false"\r
+ id="eu.etaxonomy.taxeditor.dataimport.DataImportEditor"\r
+ name="Data Import Editor">\r
+ </editor>\r
</extension>\r
<extension\r
point="org.eclipse.ui.menus">\r
id="bulkeditor.menus.openmenu"\r
label="Bulk Editor">\r
</menu>\r
+ <menu\r
+ label="Search Specimen">\r
+ </menu>\r
</menuContribution>\r
<menuContribution\r
locationURI="menu:bulkeditor.menus.openmenu">\r
style="push">\r
</command>\r
</menuContribution>\r
+ <menuContribution\r
+ allPopups="false"\r
+ locationURI="popup:eu.etaxonomy.taxeditor.editor.view.media">\r
+ <command\r
+ commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addDerivedUnitMedia"\r
+ label="Add Derived Unit Media"\r
+ style="push">\r
+ </command>\r
+ <command\r
+ commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addFieldObjectMedia"\r
+ label="Add Field Object Media"\r
+ style="push">\r
+ </command>\r
+ </menuContribution>\r
</extension>\r
<extension\r
point="org.eclipse.ui.commands">\r
id="bulkeditor.commands.removemergecandidate"\r
name="Remove as Candidate for Group Merge">\r
</command>\r
+ <command\r
+ defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMarkerFlagHandler"\r
+ id="taxeditor-bulkeditor.command.setMarkerFlag"\r
+ name="Set Marker Flag">\r
+ </command>\r
+ <command\r
+ defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AddDerivedUnitMediaHandler"\r
+ id="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addDerivedUnitMedia"\r
+ name="Add Derived Unit Media">\r
+ </command>\r
+ <command\r
+ defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AddFieldObjectMediaHandler"\r
+ id="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addFieldObjectMedia"\r
+ name="Add Field Object Media">\r
+ </command>\r
<!--command\r
defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.NewEntityHandler"\r
id="eu.etaxonomy.taxeditor.bulkeditor.command.new"\r
type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
</propertyTester>\r
</extension>\r
- <extension\r
- point="org.eclipse.ui.commands">\r
- <command\r
- defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMarkerFlagHandler"\r
- id="taxeditor-bulkeditor.command.setMarkerFlag"\r
- name="Set Marker Flag">\r
- </command>\r
- </extension>\r
<extension\r
point="org.eclipse.ui.handlers">\r
<handler\r
name="Bulk Editor">\r
</page>\r
</extension>\r
- <extension\r
- point="org.eclipse.ui.menus">\r
- <menuContribution\r
- allPopups="false"\r
- locationURI="popup:eu.etaxonomy.taxeditor.editor.view.media">\r
- <command\r
- commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addDerivedUnitMedia"\r
- label="Add Derived Unit Media"\r
- style="push">\r
- </command>\r
- <command\r
- commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addFieldObjectMedia"\r
- label="Add Field Object Media"\r
- style="push">\r
- </command>\r
- </menuContribution>\r
- </extension>\r
- <extension\r
- point="org.eclipse.ui.commands">\r
- <command\r
- defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AddDerivedUnitMediaHandler"\r
- id="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addDerivedUnitMedia"\r
- name="Add Derived Unit Media">\r
- </command>\r
- <command\r
- defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AddFieldObjectMediaHandler"\r
- id="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addFieldObjectMedia"\r
- name="Add Field Object Media">\r
- </command>\r
- </extension>\r
<extension\r
point="org.eclipse.core.expressions.propertyTesters">\r
<propertyTester\r
id="eu.etaxonomy.taxeditor.view.detail">\r
</showInPart>\r
</perspectiveExtension>\r
+ </extension>\r
+ <extension\r
+ point="org.eclipse.ui.importWizards">\r
+ <wizard\r
+ category="eu.etaxonomy.taxeditor.import.category.cdm"\r
+ class="eu.etaxonomy.taxeditor.dataimport.wizard.SpecimenSearchWizard"\r
+ id="eu.etaxonomy.taxeditor.dataimport.wizard.SpecimenSearchWizard"\r
+ name="Query BioCASE">\r
+ </wizard>\r
</extension>
<!-- start set marker -->\r
\r
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.texteditor.AbstractDocumentProvider;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
+import eu.etaxonomy.taxeditor.dataimport.DerivedUnitEditorInput;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
private LineAnnotationModel annotationModel;
private IEntityCreator<?> entityCreator;
-
+
private ILineDisplayStrategy lineDisplayStrategy;
private IEditorInput input;
-
+
/**
* <p>Constructor for AnnotatedLineDocumentProvider.</p>
*
public AnnotatedLineDocumentProvider(IEditorInput input){
this.input = input;
}
-
+
/** {@inheritDoc} */
@Override
public IAnnotationModel getAnnotationModel(Object element) {
if (element == input) {
-
+
// Create model as necessary
if (annotationModel == null) {
annotationModel = new LineAnnotationModel(getLineDisplayStrategy(element));
}
return annotationModel;
}
-
+
return null;
}
-
+
/** {@inheritDoc} */
@Override
protected IAnnotationModel createAnnotationModel(Object element)
public IDocument getDocument(Object element) {
return document;
}
-
+
/** {@inheritDoc} */
@Override
protected IDocument createDocument(Object element) throws CoreException {
-
+
if (element instanceof IEditorInput) {
IEditorInput input = (IEditorInput) element;
document = new Document("");
// IAnnotationModel model = getAnnotationModel(element);
-
+
List<?> entityList = getEntityList(element);
-
+
if(entityList != null){
for (Object entity : entityList) {
try {
createAnnotatedLine(input, entity);
} catch (BadLocationException e) {
- BulkEditorUtil.error(getClass(), "Problems creating annotated line: ", e);
+ AbstractUtility.error(getClass(), "Problems creating annotated line: ", e);
}
- }
+ }
}
-
+
return document;
}
return null;
* @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
*/
protected LineAnnotation createAnnotatedLine(Object element, Object entity) throws BadLocationException {
-
+
Document document = (Document) getDocument(element);
ILineDisplayStrategy lineDisplayStrategy = getLineDisplayStrategy(element);
-
+
LineAnnotation annotation = new LineAnnotation(entity, lineDisplayStrategy);
-
+
// Is document zero length, or is last char in document line delimiter?
int docLength = document.getLength();
boolean useDelimiter = false;
if (useDelimiter) {
document.replace(docLength, 0, document.getDefaultLineDelimiter());
}
-
+
String text;
if (lineDisplayStrategy.isEntityCacheEmpty(entity)) {
text = lineDisplayStrategy.getEmptyCacheMessage(entity);
text += lineDisplayStrategy.getSupplementalText(entity);
docLength = document.getLength();
document.replace(docLength, 0, text);
-
+
Position position = new Position(docLength, text.length());
-
+
IAnnotationModel model = getAnnotationModel(element);
if(model != null){
model.addAnnotation(annotation, position);
}
-
-// lineDisplayStrategy.addDisplayListener(entity,
+
+// lineDisplayStrategy.addDisplayListener(entity,
// new EntityListenerImpl((LineAnnotation) annotation, element));
-//
+//
return annotation;
}
-
-
+
+
/**
* <p>updateLineFromAnnotation</p>
*
* @param annotation a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
*/
public void updateLineFromAnnotation(LineAnnotation annotation) {
-
+
IAnnotationModel model = getAnnotationModel(input);
IDocument document = getDocument(input);
ILineDisplayStrategy lineDisplay = getLineDisplayStrategy(input);
-
+
Object entity = annotation.getEntity();
String text = "";
if (getLineDisplayStrategy(input).isEntityCacheEmpty(entity)) {
text = lineDisplay.getEmptyCacheMessage(entity);
} else {
text = lineDisplay.getText(entity);
- }
+ }
text += lineDisplay.getSupplementalText(entity);
-
+
try {
if (model.getPosition(annotation) == null) {
return;
}
- int offset = model.getPosition(annotation).getOffset();
+ int offset = model.getPosition(annotation).getOffset();
int line = document.getLineOfOffset(offset);
int lineLength = document.getLineLength(document.getLineOfOffset(offset));
if (document.getLineDelimiter(line) != null) {
}
document.replace(offset, lineLength, text);
} catch (BadLocationException e) {
- BulkEditorUtil.error(getClass(), "Problem updating annotated line: " ,e);
+ AbstractUtility.error(getClass(), "Problem updating annotated line: " ,e);
}
}
-
+
/**
- * @param element
+ * @param element
* @return
*/
private List<?> getEntityList(Object element) {
if (element instanceof AbstractBulkEditorInput) {
return ((AbstractBulkEditorInput)element).getModel();
}
+ else if(element instanceof DerivedUnitEditorInput){
+ return ((DerivedUnitEditorInput) element).getResults();
+ }
return null;
}
protected void doSaveDocument(IProgressMonitor monitor, Object element,
IDocument document, boolean overwrite) throws CoreException {
if (element instanceof AbstractBulkEditorInput) {
-
+
IEntityPersistenceService persistenceService = (AbstractBulkEditorInput) element;
-
+
// Get new containers from annotation model
LineAnnotationModel model = (LineAnnotationModel) getAnnotationModel(element);
Iterator iterator = model.getAnnotationIterator();
continue;
}
if (annotation.isMarkedAsMerged()) {
- persistenceService.merge(annotation.getEntity(), annotation.getMergeTarget()); // merge
+ persistenceService.merge(annotation.getEntity(), annotation.getMergeTarget()); // merge
} else {
// TODO clarify w AM whether this needs to be executed on merged objects
//persistenceService.delete(annotation.getEntity()); // delete
protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
return null;
}
-
+
/** {@inheritDoc} */
@Override
public boolean isModifiable(Object element) {
return true;
}
-
+
/** {@inheritDoc} */
@Override
public boolean isReadOnly(Object element) {
// enables copy & paste
return false;
}
-
+
/**
* <p>Getter for the field <code>entityCreator</code>.</p>
*
ILineDisplayStrategy lineDisplayStrategy, Object element) {
if (element instanceof IEditorInput) {
this.lineDisplayStrategy = lineDisplayStrategy;
- }
+ }
}
-
+
/**
* <p>Getter for the field <code>lineDisplayStrategy</code>.</p>
*
}
return null;
}
-
+
/**
* <p>removeAnnotatedLine</p>
*
LineAnnotation annotation = (LineAnnotation) annotationModel.getAnnotation(entity);
removeAnnotatedLine(annotation);
}
-
+
/**
* <p>removeAnnotatedLine</p>
*
LineAnnotation annotation = (LineAnnotation) annotationModel.getAnnotationAtLine(lineno, document);
removeAnnotatedLine(annotation);
}
-
+
/**
* <p>removeAnnotatedLine</p>
*
if (annotation != null) {
Document document = (Document) getDocument(input);
LineAnnotationModel model = (LineAnnotationModel) getAnnotationModel(input);
-
+
Position position = model.getPosition(annotation);
int offset = position.getOffset();
int length = position.getLength();
-
+
Object entity = annotation.getEntity();
annotation.markAsDeleted();
model.removeAnnotation(annotation);
-
+
// Immediately followed by a delimiter?
int annotationEnd = offset + length;
try {
length += 2;
}
} catch (BadLocationException e1) {
- BulkEditorUtil.error(getClass(), "Problems removing annotated line", e1);
+ AbstractUtility.error(getClass(), "Problems removing annotated line", e1);
}
-
+
try {
document.replace(offset, length, "");
} catch (BadLocationException e) {
- BulkEditorUtil.error(getClass(), "Problems removing annotated line", e);
+ AbstractUtility.error(getClass(), "Problems removing annotated line", e);
}
- }
+ }
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractDocumentProvider#changed(java.lang.Object)
*/
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.bulkeditor;
-import java.util.Iterator;
-
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.AnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.IVerticalRuler;
import org.eclipse.jface.util.IPropertyChangeListener;
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
public static final String ID = "bulkeditor.editor";
private boolean isInitialFocus = true;
-
+
private BulkEditorSearch searchBar = null;
-
+
private IPropertyChangeListener markerPreferenceListener;
/**
@Override
protected void initializeEditor() {
super.initializeEditor();
-
+
/**
* see AbstractTextEditor javadoc for explanation of context menu ids
*/
setEditorContextMenuId("#BulkEditorContext");
// setEntityCreatorService(new BulkEditorEntityCreatorService());
-
+
setLineDisplayStrategy(new BulkEditorLineDisplay(this));
-
+
setSourceViewerConfiguration(new BulkEditorViewerConfiguration(lineDisplayStrategy));
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.bulkeditor.ListEditor#createSourceViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.source.IVerticalRuler, int)
*/
/** {@inheritDoc} */
- protected ISourceViewer createSourceViewer(Composite parent,
+ @Override
+ protected ISourceViewer createSourceViewer(Composite parent,
IVerticalRuler ruler, int styles) {
ISourceViewer viewer = super.createSourceViewer(parent, ruler, styles);
- if (((AbstractBulkEditorInput) getEditorInput()).isMergingEnabled()) {
+ if (getEditorInput().isMergingEnabled()) {
addToggleMergeCandidateListener(ruler.getControl());
}
return viewer;
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.bulkeditor.AnnotatedLineEditor#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
*/
@Override
public void init(IEditorSite site, IEditorInput input)
throws PartInitException {
-
+
if (!(input instanceof AbstractBulkEditorInput)) {
throw new PartInitException("Invalid Input: Must be BulkEditorInput");
}
-
+
super.init(site, input);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createPartControl(org.eclipse.swt.widgets.Composite)
*/
/** {@inheritDoc} */
@Override
public void createPartControl(Composite parent) {
-
+
parent.setLayout(new GridLayout());
-
+
Composite layoutComposite = new Composite(parent, SWT.NONE);
layoutComposite.setLayout(new GridLayout());
GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false);
layoutComposite.setLayoutData(gridData);
-
+
// layoutComposite.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
-
-
+
+
searchBar = new BulkEditorSearch(this, layoutComposite, SWT.NONE);
// layoutComposite.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
-
+
super.createPartControl(parent);
-
+
// Set viewer composite to fill grid. Unfortunately it is private and we have to do a little hack here.
for (Control control : parent.getChildren()) {
- if (control instanceof Composite &&
+ if (control instanceof Composite &&
!(control.equals(layoutComposite))) {
control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
}
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.editors.text.TextEditor#dispose()
*/
public void setFocus() {
searchBar.setFocus();
- // TODO find a better place to put this - this dialog should be shown after initial contents of
+ // TODO find a better place to put this - this dialog should be shown after initial contents of
// Editor are displayed
if (isInitialFocus) {
displayWarningDialog();
isInitialFocus = false;
}
}
-
+
/**
- *
+ *
*/
private void displayWarningDialog() {
IPreferenceStore prefs = PreferencesUtil.getPreferenceStore();
- if (!prefs.getBoolean(PreferencesUtil.HIDE_BULKEDITOR_INFO)) {
+ if (!prefs.getBoolean(IPreferenceKeys.HIDE_BULKEDITOR_INFO)) {
String msg = "The Bulk Editor allows you to edit objects used to reference other objects, such as names, references, and authors.\n\n" +
"Any changes you make to an object in the Bulk Editor will be displayed wherever the object is used.\n\n" +
"For instance, a reference may be displayed with both a name and a descriptive element. If the reference name is changed here, the display of both the name and the descriptive element will be affected.";
MessageDialogWithToggle dialog = MessageDialogWithToggle.openOkCancelConfirm
- (getSite().getShell(), "Bulk Editor", msg, "Do not show this message again",
- false, null, PreferencesUtil.HIDE_BULKEDITOR_INFO);
- if (dialog.getReturnCode() == Window.OK) {
- prefs.setValue(PreferencesUtil.HIDE_BULKEDITOR_INFO, dialog.getToggleState());
+ (getSite().getShell(), "Bulk Editor", msg, "Do not show this message again",
+ false, null, IPreferenceKeys.HIDE_BULKEDITOR_INFO);
+ if (dialog.getReturnCode() == Window.OK) {
+ prefs.setValue(IPreferenceKeys.HIDE_BULKEDITOR_INFO, dialog.getToggleState());
}
}
}
-
+
/**
* @param control
*/
* @param line a int.
*/
public void toggleMergeCandidateAnnotation(int line) {
-
+
IDocument document = getSourceViewer().getDocument();
- LineAnnotationModel model =
+ LineAnnotationModel model =
(LineAnnotationModel) getSourceViewer().getAnnotationModel();
-
+
if(model != null){
Annotation annotation = model.getAnnotationAtLine(line, document);
-
+
if (annotation != null) {
if (annotation.getType().equals(IBulkEditorConstants.TYPE_MERGE_CANDIDATE)) {
model.changeAnnotationType(
}
}
}
-
+
/** {@inheritDoc} */
- public void changed(Object object) {
+ @Override
+ public void changed(Object object) {
// this.dirty = dirty;
AnnotatedLineDocumentProvider p = (AnnotatedLineDocumentProvider) getDocumentProvider();
p.changed(object);
// firePropertyChange(PROP_DIRTY);
}
-
+
/* (non-Javadoc)
* @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
*/
/** {@inheritDoc} */
public void performSearch(BulkEditorQuery query) {
if (query != null) {
-
+
// TODO check if dirty, prompt save
if (isDirty()) {
- boolean proceed = MessageDialog.openQuestion(getEditorSite().getShell(),
+ boolean proceed = MessageDialog.openQuestion(getEditorSite().getShell(),
"Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");
if (proceed) {
doSave(null);
return;
}
}
-
+
getEditorInput().performSearch(query);
-
+
refresh();
-
+
selectFirstItem();
-
+
getSourceViewer().getTextWidget().setFocus();
}
}
-
+
private void selectFirstItem() {
- ITextSelection selection = new TextSelection(0, 0);
+ ITextSelection selection = new TextSelection(0, 0);
getSelectionProvider().setSelection(selection);
}
/**
- *
+ *
*/
public void refresh() {
if(getDocumentProvider().getAnnotationModel(getEditorInput()) != null){
((AnnotationModel) getDocumentProvider().getAnnotationModel(getEditorInput())).removeAllAnnotations();
}
-
+
setInput(getEditorInput());
}
-
+
/** {@inheritDoc} */
@Override
public AbstractBulkEditorInput getEditorInput() {
return (AbstractBulkEditorInput) super.getEditorInput();
}
-
- protected void editorContextMenuAboutToShow(IMenuManager menu) {
+
+ @Override
+ protected void editorContextMenuAboutToShow(IMenuManager menu) {
super.editorContextMenuAboutToShow(menu);
menu.remove(ITextEditorActionConstants.SHIFT_RIGHT);
menu.remove(ITextEditorActionConstants.SHIFT_LEFT);
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
* @version 1.0
*/
public class BulkEditorLineDisplay implements ILineDisplayStrategy {
-
+
private BulkEditor editor;
/**
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#getIcon(java.lang.Object)
*/
/** {@inheritDoc} */
- public Image getIcon(Object entity) {
+ @Override
+ public Image getIcon(Object entity) {
return null;
}
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#getIndent(java.lang.Object)
*/
/** {@inheritDoc} */
- public int getIndent(Object entity) {
+ @Override
+ public int getIndent(Object entity) {
return 0;
}
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#getText(java.lang.Object)
*/
/** {@inheritDoc} */
- public String getText(Object entity) {
+ @Override
+ public String getText(Object entity) {
return editor.getEditorInput().getText((ICdmBase) entity);
}
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getSupplementalText(java.lang.Object)
*/
/** {@inheritDoc} */
- public String getSupplementalText(Object entity) {
-
+ @Override
+ public String getSupplementalText(Object entity) {
+
String supplementalText = "";
-
+
AbstractBulkEditorInput input = editor.getEditorInput();
String typeText = input.getTypeText(entity);
-
+
supplementalText += StringUtils.isBlank(typeText) ? "" : String.format(" [%s]", typeText);
-
+
if (entity instanceof IAnnotatableEntity) {
IAnnotatableEntity annotatableEntity = (IAnnotatableEntity) HibernateProxyHelper.deproxy(entity);
Map<MarkerType, Boolean> editMarkerTypePreferences = PreferencesUtil.getEditMarkerTypePreferences();
-
+
String markerText = "";
List<String> markers = new ArrayList<String>();
for (Marker marker : annotatableEntity.getMarkers()) {
if (! markers.isEmpty()) {
markerText = StringUtils.join(markers, ", ");
}
-
+
supplementalText += StringUtils.isBlank(markerText) ? "" : String.format(" [%s]", markerText);
}
-
+
return supplementalText;
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#setText(java.lang.String, java.lang.Object)
*/
/** {@inheritDoc} */
- public void setText(String text, Object entity) {
+ @Override
+ public void setText(String text, Object entity) {
if (entity instanceof Reference) {
- ((Reference) entity).setTitleCache(text);
+ ((Reference) entity).setTitleCache(text);
}
}
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#getHoverText(java.lang.Object)
*/
/** {@inheritDoc} */
- public String getHoverText(Object entity) {
+ @Override
+ public String getHoverText(Object entity) {
return null;
}
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#setStatusMessage(java.lang.String, java.lang.Object)
*/
/** {@inheritDoc} */
- public void setStatusMessage(final String text, Object entity) {
-
+ @Override
+ public void setStatusMessage(final String text, Object entity) {
+
// Calling from the synchronized method ListEditorReconcilingStrategy#doReconcile
// without its own thread causes an invalid thread access exception
// see http://wiki.eclipse.org/FAQ_Why_do_I_get_an_invalid_thread_access_exception%3F
new Thread(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
Display.getDefault().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
IStatusLineManager statusLineManager = editor.getEditorSite().getActionBars().getStatusLineManager();
statusLineManager.setMessage(text);
}
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getEmptyText(java.lang.Object)
*/
/** {@inheritDoc} */
- public String getEmptyCacheMessage(Object entity) {
+ @Override
+ public String getEmptyCacheMessage(Object entity) {
if (entity instanceof Reference) {
return "No reference title cache";
}
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#isEntityCacheEmpty(java.lang.Object)
*/
/** {@inheritDoc} */
- public boolean isEntityCacheEmpty(Object entity) {
+ @Override
+ public boolean isEntityCacheEmpty(Object entity) {
if (entity instanceof Reference) {
String text = ((Reference) entity).getTitleCache();
return (text == null || text.equals(""));
}
if (entity instanceof TaxonNameBase) {
- String text = ((TaxonNameBase) entity).getTitleCache();
+ String text = ((TaxonNameBase) entity).getTitleCache();
return (text == null || text.equals(""));
}
if (entity instanceof AgentBase) {
- String text = ((AgentBase) entity).getTitleCache();
+ String text = ((AgentBase) entity).getTitleCache();
return (text == null || text.equals(""));
}
return false;
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#addDisplayListener(java.lang.Object)
*/
/** {@inheritDoc} */
- public void addDisplayListener(Object entity, EntityListener listener) {
- /* Note: all non-field specific listeners require that corresponding property sheets
+ @Override
+ public void addDisplayListener(Object entity, EntityListener listener) {
+ /* Note: all non-field specific listeners require that corresponding property sheets
* contain the following:
- *
- *
+ *
+ *
* public void setPropertyValue(Object id, Object value) {
* ...
* reference.firePropertyChange(new PropertyChangeEvent(reference, "", null, null));
* }
- *
+ *
*/
if (entity instanceof CdmBase) {
((CdmBase) entity).addPropertyChangeListener(listener);
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getFont(java.lang.Object)
*/
/** {@inheritDoc} */
- public Font getFont(Object entity) {
+ @Override
+ public Font getFont(Object entity) {
return null;
}
}
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
import org.eclipse.ui.actions.CompoundContributionItem;
import org.eclipse.ui.handlers.IHandlerService;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
public class DynamicNewObjectMenu extends CompoundContributionItem {
private static final Logger logger = Logger
.getLogger(DynamicNewObjectMenu.class);
-
+
private IHandlerService handlerService = (IHandlerService) BulkEditorUtil.getService(IHandlerService.class);
private Map<Object, String> classLabelPairs;
/* (non-Javadoc)
/** {@inheritDoc} */
@Override
protected IContributionItem[] getContributionItems() {
-
+
classLabelPairs = getClassLabelPairs();
-
+
return new IContributionItem[] {
new ContributionItem() {
- public void fill(Menu menu, int index){
+ @Override
+ public void fill(Menu menu, int index){
for(final Object key : classLabelPairs.keySet()){
createMenuItem(menu, key);
- }
+ }
}
}
};
menuItem.setText(classLabelPairs.get(key));
menuItem.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e) {}
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent ev) {
+ @Override
+ public void widgetSelected(SelectionEvent ev) {
Event event = new Event();
event.data = key;
event.text = classLabelPairs.get(key);
logger.error("Error executing command", e);
throw new RuntimeException("Error executing command", e);
}
- }
+ }
});
-
- //FIXME:3.3MC Need corresponding Details Viewer section for FieldUnit
- if(key == SpecimenOrObservationType.FieldUnit){
- menuItem.setEnabled(false);
- }
}
-
+
/**
* Get class label pairs from Annotated Line Editor's entity creator.
* @return
IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor != null){
IEditorInput input = editor.getEditorInput();
-
+
if(input instanceof AbstractBulkEditorInput){
IEntityCreator<?> entityCreator = ((AbstractBulkEditorInput) input).getEntityCreator();
return entityCreator.getKeyLabelPairs();
}
}
-
+
return null;
- }
+ }
}
// $Id$
/**
* Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
+ * 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.
*/
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputType;
+import eu.etaxonomy.taxeditor.dataimport.DataImportEditor;
/**
* <p>
* OpenBulkEditorContributionItem class.
* </p>
- *
+ *
* @author p.ciardelli
* @created 19.08.2009
* @version 1.0
*/
public class OpenBulkEditorContributionItem extends CompoundContributionItem {
- /**
- * <p>
- * Constructor for OpenBulkEditorContributionItem.
- * </p>
- */
- public OpenBulkEditorContributionItem() {
- }
+ /**
+ * <p>
+ * Constructor for OpenBulkEditorContributionItem.
+ * </p>
+ */
+ public OpenBulkEditorContributionItem() {
+ }
- /**
- * <p>
- * Constructor for OpenBulkEditorContributionItem.
- * </p>
- *
- * @param id
- * a {@link java.lang.String} object.
- */
- public OpenBulkEditorContributionItem(String id) {
- super(id);
- }
+ /**
+ * <p>
+ * Constructor for OpenBulkEditorContributionItem.
+ * </p>
+ *
+ * @param id
+ * a {@link java.lang.String} object.
+ */
+ public OpenBulkEditorContributionItem(String id) {
+ super(id);
+ }
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
- */
- /** {@inheritDoc} */
- @Override
- protected IContributionItem[] getContributionItems() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected IContributionItem[] getContributionItems() {
- List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
+ List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
- contributionItems.add(BulkEditorInputType.AGENT.createContributionItem());
- contributionItems.add(BulkEditorInputType.REFERENCE.createContributionItem());
- contributionItems.add(new Separator("test"));
- contributionItems.add(BulkEditorInputType.NAME.createContributionItem());
- contributionItems.add(BulkEditorInputType.NAME_RELATIONSHIP.createContributionItem());
- contributionItems.add(new Separator("test"));
- contributionItems.add(BulkEditorInputType.OCCURRENCE.createContributionItem());
- contributionItems.add(new Separator("test"));
- contributionItems.add(BulkEditorInputType.USER.createContributionItem());
- contributionItems.add(BulkEditorInputType.GROUP.createContributionItem());
+ contributionItems.add(BulkEditorInputType.AGENT.createContributionItem());
+ contributionItems.add(BulkEditorInputType.REFERENCE.createContributionItem());
+ String groupName = "test";
+ contributionItems.add(new Separator(groupName));
+ contributionItems.add(BulkEditorInputType.NAME.createContributionItem());
+ contributionItems.add(BulkEditorInputType.NAME_RELATIONSHIP.createContributionItem());
+ contributionItems.add(new Separator(groupName));
+ contributionItems.add(BulkEditorInputType.OCCURRENCE.createContributionItem());
+ contributionItems.add(new Separator(groupName));
+ contributionItems.add(BulkEditorInputType.USER.createContributionItem());
+ contributionItems.add(BulkEditorInputType.GROUP.createContributionItem());
+ contributionItems.add(new Separator(groupName));
+ contributionItems.add(createContributionItem("Search Specimen", DataImportEditor.ID));
- return contributionItems
- .toArray(new IContributionItem[contributionItems.size()]);
- }
+ return contributionItems.toArray(new IContributionItem[contributionItems.size()]);
+ }
- /**
- * @param key
- * @param object
- * @return
- */
- private IContributionItem createContributionItem(String label,
- String inputType) {
- CommandContributionItemParameter parameter = new CommandContributionItemParameter(
- PlatformUI.getWorkbench().getActiveWorkbenchWindow(), null,
- IBulkEditorConstants.DYNAMIC_OPEN_MENU_ID, SWT.NONE);
+ /**
+ * @param key
+ * @param object
+ * @return
+ */
+ private IContributionItem createContributionItem(String label, String inputType) {
+ CommandContributionItemParameter parameter = new CommandContributionItemParameter(PlatformUI.getWorkbench().getActiveWorkbenchWindow(), null, IBulkEditorConstants.DYNAMIC_OPEN_MENU_ID, SWT.NONE);
- parameter.label = label;
+ parameter.label = label;
- Map parameters = new HashMap();
- parameters.put(IBulkEditorConstants.INPUT_TYPE_PARAMETER_ID, inputType);
- parameter.parameters = parameters;
+ Map<String, String> parameters = new HashMap<String, String>();
+ parameters.put(IBulkEditorConstants.INPUT_TYPE_PARAMETER_ID, inputType);
+ parameter.parameters = parameters;
- return new CommandContributionItem(parameter);
- }
+ return new CommandContributionItem(parameter);
+ }
}
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
import eu.etaxonomy.cdm.model.common.ICdmBase;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.strategy.merge.IMergable;
import eu.etaxonomy.cdm.strategy.merge.MergeException;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorQuery;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.CdmBaseSortProvider;
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.TitleCacheComparator;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
public abstract class AbstractBulkEditorInput<T extends ICdmBase> implements IEditorInput, IEntityPersistenceService<T> {
/**
- *
+ *
*/
private static final long serialVersionUID = 416414530232743735L;
private UUID entityUuid;
private List<T> model;
-
+
private IEntityCreator<T> entityCreator;
-
+
/**
* <p>NewInstance</p>
*
static public AbstractBulkEditorInput NewInstance(BulkEditorInputType inputType) {
return BulkEditorInputType.getInput(inputType);
}
-
+
/**
* <p>NewInstance</p>
*
* @return a {@link eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput} object.
*/
public static AbstractBulkEditorInput NewInstance(IdentifiableEntity entity) {
-
-
+
+
BulkEditorInputType inputType = BulkEditorInputType.getByType(entity.getClass());
-
+
AbstractBulkEditorInput editorInput = NewInstance(inputType);
-
+
editorInput.setEntityUuid(entity.getUuid());
-
+
return editorInput;
}
-
+
/**
* <p>listEntities</p>
*
* @return a {@link java.util.List} object.
*/
protected abstract List<T> listEntities(IIdentifiableEntityServiceConfigurator configurator);
-
+
/**
* <p>loadEntity</p>
*
private void setEntityUuid(UUID entityUuid){
this.entityUuid = entityUuid;
}
-
+
/**
* <p>Getter for the field <code>entityUuid</code>.</p>
*
return entityUuid;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorInput#exists()
*/
*
* @return a boolean.
*/
- public boolean exists() {
+ @Override
+ public boolean exists() {
// TODO Auto-generated method stub
return false;
}
*
* @return a {@link org.eclipse.jface.resource.ImageDescriptor} object.
*/
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
// TODO Auto-generated method stub
return null;
}
*
* @return a {@link org.eclipse.ui.IPersistableElement} object.
*/
- public IPersistableElement getPersistable() {
+ @Override
+ public IPersistableElement getPersistable() {
return null;
}
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
/** {@inheritDoc} */
- @SuppressWarnings("unchecked")
+ @Override
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
return null;
}
* @param bulkEditorQuery a {@link eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery} object.
*/
public void performSearch(final BulkEditorQuery bulkEditorQuery) {
-
+
List<T> entityList = new ArrayList<T>();
-
+
if(getEntityUuid() != null){
-
+
T entity = loadEntity(getEntityUuid());
entityList.add(entity);
model = entityList;
}
else if(bulkEditorQuery != null){
-
- String queryString = bulkEditorQuery.getSearchString();
+
IIdentifiableEntityServiceConfigurator configurator = bulkEditorQuery.getSearchConfigurator();
Comparator queryComparator = (bulkEditorQuery.getComparator() != null) ? bulkEditorQuery.getComparator() : new TitleCacheComparator();
-
+
entityList = listEntities(configurator);
-
- Collections.sort(entityList, queryComparator);
-
+
+ Collections.sort(entityList, queryComparator);
+
}
-
+
model = entityList;
}
-
+
/**
* <p>isMergingEnabled</p>
*
public boolean isMarkerTypeEditingEnabled(MarkerType markerType) {
return false;
}
-
+
/*
* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#merge(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
*/
/** {@inheritDoc} */
- public boolean merge(T entity, T mergeTarget) {
+ @Override
+ public boolean merge(T entity, T mergeTarget) {
if (entity instanceof IMergable) {
try {
CdmStore.getService(ICommonService.class).merge((IMergable)mergeTarget, (IMergable)entity, null);
} catch (MergeException e) {
- BulkEditorUtil.error(getClass(), e);
+ AbstractUtility.error(getClass(), e);
}
}
return true;
- };
-
+ }
+
/*
* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#create(eu.etaxonomy.cdm.model.common.IdentifiableEntity)
*/
/** {@inheritDoc} */
- public boolean create(T entity) {
- return save(entity);
- };
-
+ @Override
+ public boolean create(T entity) {
+ return save(entity);
+ }
+
public IEntityCreator<T> getEntityCreator(){
if(entityCreator == null){
entityCreator = createEntityCreator();
*/
public List<IBulkEditorSortProvider<T>> getSortProviders(){
List<IBulkEditorSortProvider<T>> sortProviders = new ArrayList<IBulkEditorSortProvider<T>>();
-
+
sortProviders.add(new CdmBaseSortProvider<T>());
-
+
return sortProviders;
}
* @return
*/
public String getTypeText(Object entity){
- return entity.getClass().getSimpleName();
+ return ((SpecimenOrObservationBase) entity).getRecordBasis().toString();
}
/**
public String getText(T entity) {
if(entity instanceof IdentifiableEntity){
IdentifiableEntity identifiableEntity = (IdentifiableEntity) HibernateProxyHelper.deproxy(entity);
-
+
return identifiableEntity.getTitleCache();
}
-
+
return "No text. Implement in subclass";
}
-
+
/**
* @return
*/
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
* @version 1.0
*/
public class OccurrenceEditorInput extends AbstractBulkEditorInput<SpecimenOrObservationBase> {
-
+
/**
- *
+ *
*/
private static final long serialVersionUID = 1014860873939989973L;
public static final String ID = "bulkeditor.input.occurrence";
private static OccurrenceEditorInput instance;
-
+
/**
* <p>Getter for the field <code>instance</code>.</p>
*
}
return instance;
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#listEntities(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
*/
/** {@inheritDoc} */
@Override
protected SpecimenOrObservationBase loadEntity(UUID entityUuid) {
- List<String> propertyPaths = Arrays.asList(new String[]{});
+ List<String> propertyPaths = Arrays.asList(new String[]{});
return CdmStore.getService(IOccurrenceService.class).load(entityUuid, propertyPaths);
}
*
* @return a {@link java.lang.String} object.
*/
- public String getName() {
+ @Override
+ public String getName() {
return BulkEditorInputType.OCCURRENCE.label;
}
*
* @return a {@link java.lang.String} object.
*/
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return getName();
}
-
+
/**
* <p>getId</p>
*
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#delete(java.lang.Object)
*/
/** {@inheritDoc} */
- public boolean delete(SpecimenOrObservationBase entity) {
+ @Override
+ public boolean delete(SpecimenOrObservationBase entity) {
return CdmStore.getService(IOccurrenceService.class).delete(entity) != null;
}
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#save(java.lang.Object)
*/
/** {@inheritDoc} */
- public boolean save(SpecimenOrObservationBase entity) {
+ @Override
+ public boolean save(SpecimenOrObservationBase entity) {
return CdmStore.getService(IOccurrenceService.class).save(entity) != null;
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#createEntityCreator()
@Override
public List<IBulkEditorSortProvider<SpecimenOrObservationBase>> getSortProviders() {
List<IBulkEditorSortProvider<SpecimenOrObservationBase>> sortProviders = super.getSortProviders();
-
+
sortProviders.add(0, new IdentifiableEntitySortProvider<SpecimenOrObservationBase>());
-
+
return sortProviders;
}
}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ui.IEditorInput;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor;
+
+/**
+ * @author pplitzner
+ * @date 20.09.2013
+ *
+ */
+public class DataImportEditor extends AnnotatedLineEditor {
+
+ /** Constant <code>ID="bulkeditor.input.nameRelationship"</code> */
+ public static final String ID = "eu.etaxonomy.taxeditor.dataimport.DataImportEditor";
+
+ /**
+ * Constructs a new DataImportEditor with a new {@link ConversationHolder}
+ */
+ public DataImportEditor() {
+ super(null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.editors.text.TextEditor#initializeEditor()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected void initializeEditor() {
+ super.initializeEditor();
+ setLineDisplayStrategy(new DataImportEditorLineDisplayStrategy());
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor#doSetInput(org.eclipse.ui.IEditorInput)
+ */
+ @Override
+ protected void doSetInput(IEditorInput input) throws CoreException {
+ super.doSetInput(input);
+ setPartName(input.getName());
+ setTitleToolTip(input.getName());
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport;
+
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener;
+import eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy;
+
+/**
+ * @author pplitzner
+ * @date 20.09.2013
+ *
+ */
+public class DataImportEditorLineDisplayStrategy implements ILineDisplayStrategy {
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getIndent(java.lang.Object)
+ */
+ @Override
+ public int getIndent(Object entity) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getIcon(java.lang.Object)
+ */
+ @Override
+ public Image getIcon(Object entity) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getFont(java.lang.Object)
+ */
+ @Override
+ public Font getFont(Object entity) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object entity) {
+ return ((SpecimenOrObservationBase)entity).getTitleCache();
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getSupplementalText(java.lang.Object)
+ */
+ @Override
+ public String getSupplementalText(Object entity) {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getEmptyCacheMessage(java.lang.Object)
+ */
+ @Override
+ public String getEmptyCacheMessage(Object entity) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#setText(java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void setText(String text, Object entity) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getHoverText(java.lang.Object)
+ */
+ @Override
+ public String getHoverText(Object entity) {
+ return ((SpecimenOrObservationBase)entity).getTitleCache();
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#setStatusMessage(java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void setStatusMessage(String text, Object entity) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#isEntityCacheEmpty(java.lang.Object)
+ */
+ @Override
+ public boolean isEntityCacheEmpty(Object entity) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#addDisplayListener(java.lang.Object, eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener)
+ */
+ @Override
+ public void addDisplayListener(Object entity, EntityListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.http.client.ClientProtocolException;
+import org.apache.log4j.Logger;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+import eu.etaxonomy.cdm.ext.biocase.BioCaseQuery;
+import eu.etaxonomy.cdm.ext.biocase.BioCaseQueryServiceWrapper;
+import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
+import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.dataimport.transientServices.TransientCdmRepository;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author pplitzner
+ * @date 20.09.2013
+ *
+ */
+public class DerivedUnitEditorInput implements IEditorInput {
+
+ private static Logger logger = Logger.getLogger(DerivedUnitEditorInput.class);
+
+ private final BioCaseQuery query;
+
+ private List<SpecimenOrObservationBase> results;
+
+ /**
+ * @param results
+ */
+ public DerivedUnitEditorInput(BioCaseQuery query) {
+ this.query = query;
+ results = new ArrayList<SpecimenOrObservationBase>();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#exists()
+ */
+ @Override
+ public boolean exists() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+ */
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getName()
+ */
+ @Override
+ public String getName() {
+ return query.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getPersistable()
+ */
+ @Override
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getToolTipText()
+ */
+ @Override
+ public String getToolTipText() {
+ return query.toString();
+ }
+
+ /**
+ * @return the results
+ */
+ public List<SpecimenOrObservationBase> getResults() {
+ if(results!=null && !results.isEmpty()){
+ return results;
+ }
+ String errorMessage = "Could not execute query " + query;
+ try {
+ InputStream resultStream = new BioCaseQueryServiceWrapper().query(query);
+ Abcd206ImportConfigurator configurator = Abcd206ImportConfigurator.NewInstance(resultStream, null, false);
+ TransientCdmRepository repo = new TransientCdmRepository(CdmStore.getCurrentApplicationConfiguration());
+ configurator.setCdmAppController(repo);
+
+ CdmDefaultImport<Abcd206ImportConfigurator> importer = new CdmDefaultImport<Abcd206ImportConfigurator>();
+ importer.invoke(configurator);
+ results = repo.getUnits();
+// Abcd206Import abcd206Import = new Abcd206Import();
+// Abcd206ImportState state = new Abcd206ImportState(configurator);
+// abcd206Import.invoke(state);
+// state.countTrees();
+ } catch (ClientProtocolException e) {
+ logger.error(errorMessage, e);
+ } catch (IOException e) {
+ logger.error(errorMessage, e);
+ } catch (URISyntaxException e) {
+ logger.error(errorMessage, e);
+ }
+// return new BioCaseQueryServiceWrapper().dummyData();
+ return results;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((query == null) ? 0 : query.hashCode());
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ DerivedUnitEditorInput other = (DerivedUnitEditorInput) obj;
+ if (query == null) {
+ if (other.query != null) {
+ return false;
+ }
+ } else if (!query.equals(other.query)) {
+ return false;
+ }
+ return true;
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.transientServices;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.hibernate.LockMode;
+import org.hibernate.Session;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.envers.query.criteria.AuditCriterion;
+
+import eu.etaxonomy.cdm.api.service.IAgentService;
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.model.agent.Address;
+import eu.etaxonomy.cdm.model.agent.AgentBase;
+import eu.etaxonomy.cdm.model.agent.Institution;
+import eu.etaxonomy.cdm.model.agent.InstitutionalMembership;
+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.ISourceable;
+import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.common.LSID;
+import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
+import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.view.AuditEvent;
+import eu.etaxonomy.cdm.model.view.AuditEventRecord;
+import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.query.Grouping;
+import eu.etaxonomy.cdm.persistence.query.MatchMode;
+import eu.etaxonomy.cdm.persistence.query.OrderHint;
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+
+/**
+ * @author pplitzner
+ * @date 27.09.2013
+ *
+ */
+public class TransientAgentService implements IAgentService {
+
+ private IAgentService defaultAgentService;
+
+ /**
+ * @param defaultAgentService
+ */
+ public TransientAgentService(IAgentService defaultAgentService) {
+ this.defaultAgentService = defaultAgentService;
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<AgentBase>> pageAuditEvents(AgentBase t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultAgentService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
+ }
+
+ /**
+ * @param annotatedObj
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Annotation> getAnnotations(AgentBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultAgentService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param code
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAgentService#searchInstitutionByCode(java.lang.String)
+ */
+ @Override
+ public List<Institution> searchInstitutionByCode(String code) {
+ return defaultAgentService.searchInstitutionByCode(code);
+ }
+
+ /**
+ * @param person
+ * @param pageSize
+ * @param pageNumber
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAgentService#getInstitutionalMemberships(eu.etaxonomy.cdm.model.agent.Person, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public Pager<InstitutionalMembership> getInstitutionalMemberships(Person person, Integer pageSize, Integer pageNumber) {
+ return defaultAgentService.getInstitutionalMemberships(person, pageSize, pageNumber);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IService#clear()
+ */
+ @Override
+ public void clear() {
+ defaultAgentService.clear();
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
+ */
+ @Override
+ public void lock(AgentBase t, LockMode lockMode) {
+ defaultAgentService.lock(t, lockMode);
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @param propertyPaths
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
+ */
+ @Override
+ public void refresh(AgentBase t, LockMode lockMode, List<String> propertyPaths) {
+ defaultAgentService.refresh(t, lockMode, propertyPaths);
+ }
+
+ /**
+ * @param team
+ * @param pageSize
+ * @param pageNumber
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAgentService#getMembers(eu.etaxonomy.cdm.model.agent.Team, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public Pager<Person> getMembers(Team team, Integer pageSize, Integer pageNumber) {
+ return defaultAgentService.getMembers(team, pageSize, pageNumber);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache()
+ */
+ @Override
+ public void updateTitleCache() {
+ defaultAgentService.updateTitleCache();
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<AgentBase> getNextAuditEvent(AgentBase t) {
+ return defaultAgentService.getNextAuditEvent(t);
+ }
+
+ /**
+ * @param annotatableEntity
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Marker> getMarkers(AgentBase annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultAgentService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param stepSize
+ * @param cacheStrategy
+ * @param monitor
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor)
+ */
+ @Override
+ public void updateTitleCache(Class<? extends AgentBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<AgentBase> cacheStrategy, IProgressMonitor monitor) {
+ defaultAgentService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor);
+ }
+
+ /**
+ * @param agent
+ * @param pageSize
+ * @param pageNumber
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAgentService#getAddresses(eu.etaxonomy.cdm.model.agent.AgentBase, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public Pager<Address> getAddresses(AgentBase agent, Integer pageSize, Integer pageNumber) {
+ return defaultAgentService.getAddresses(agent, pageSize, pageNumber);
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<AgentBase> getPreviousAuditEvent(AgentBase t) {
+ return defaultAgentService.getPreviousAuditEvent(t);
+ }
+
+ /**
+ * @param clazz
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class)
+ */
+ @Override
+ public int count(Class<? extends AgentBase> clazz) {
+ return defaultAgentService.count(clazz);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAgentService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<AgentBase> search(Class<? extends AgentBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultAgentService.search(clazz, queryString, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param from
+ * @param to
+ * @param criteria
+ * @param pageSize
+ * @param pageValue
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<AgentBase>> pageAuditEvents(Class<? extends AgentBase> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultAgentService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths);
+ }
+
+ /**
+ * @param lsid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID)
+ */
+ @Override
+ public AgentBase find(LSID lsid) {
+ return defaultAgentService.find(lsid);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID delete(AgentBase persistentObject) {
+ return defaultAgentService.delete(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Object[]> groupMarkers(Class<? extends AgentBase> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultAgentService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID)
+ */
+ @Override
+ public boolean exists(UUID uuid) {
+ return defaultAgentService.exists(uuid);
+ }
+
+ /**
+ * @param x
+ * @param y
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
+ */
+ @Override
+ public AgentBase replace(AgentBase x, AgentBase y) {
+ return defaultAgentService.replace(x, y);
+ }
+
+ /**
+ * @param uuidSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set)
+ */
+ @Override
+ public List<AgentBase> find(Set<UUID> uuidSet) {
+ return defaultAgentService.find(uuidSet);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<IdentifiableSource> getSources(AgentBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultAgentService.getSources(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID)
+ */
+ @Override
+ public AgentBase find(UUID uuid) {
+ return defaultAgentService.find(uuid);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAgentService#getPersonUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<Person>> getPersonUuidAndTitleCache() {
+ return defaultAgentService.getPersonUuidAndTitleCache();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAgentService#getTeamUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<Team>> getTeamUuidAndTitleCache() {
+ return defaultAgentService.getTeamUuidAndTitleCache();
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(int)
+ */
+ @Override
+ public AgentBase find(int id) {
+ return defaultAgentService.find(id);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<Rights> getRights(AgentBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultAgentService.getRights(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean)
+ */
+ @Override
+ public int countMarkers(Class<? extends AgentBase> clazz, Boolean technical) {
+ return defaultAgentService.countMarkers(clazz, technical);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAgentService#getTeamUuidAndNomenclaturalTitle()
+ */
+ @Override
+ public List<UuidAndTitleCache<Team>> getTeamUuidAndNomenclaturalTitle() {
+ return defaultAgentService.getTeamUuidAndNomenclaturalTitle();
+ }
+
+ /**
+ * @param idSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set)
+ */
+ @Override
+ public List<AgentBase> findById(Set<Integer> idSet) {
+ return defaultAgentService.findById(idSet);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAgentService#getInstitutionUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache() {
+ return defaultAgentService.getInstitutionUuidAndTitleCache();
+ }
+
+ /**
+ * @param clazz
+ * @param idInSource
+ * @param idNamespace
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String)
+ */
+ @Override
+ public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
+ return defaultAgentService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#getSession()
+ */
+ @Override
+ public Session getSession() {
+ return defaultAgentService.getSession();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<AgentBase>> getUuidAndTitleCache() {
+ return defaultAgentService.getUuidAndTitleCache();
+ }
+
+ /**
+ * @param clazz
+ * @param limit
+ * @param start
+ * @param groups
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Object[]> group(Class<? extends AgentBase> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) {
+ return defaultAgentService.group(clazz, limit, start, groups, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<AgentBase> findByTitle(Class<? extends AgentBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultAgentService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<AgentBase> list(Class<? extends AgentBase> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultAgentService.list(type, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Pager<AgentBase> findByTitle(IIdentifiableEntityServiceConfigurator<AgentBase> configurator) {
+ return defaultAgentService.findByTitle(configurator);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
+ */
+ @Override
+ public Integer countByTitle(Class<? extends AgentBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) {
+ return defaultAgentService.countByTitle(clazz, queryString, matchmode, criteria);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID)
+ */
+ @Override
+ public AgentBase load(UUID uuid) {
+ return defaultAgentService.load(uuid);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List)
+ */
+ @Override
+ public AgentBase load(UUID uuid, List<String> propertyPaths) {
+ return defaultAgentService.load(uuid, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Integer countByTitle(IIdentifiableEntityServiceConfigurator<AgentBase> configurator) {
+ return defaultAgentService.countByTitle(configurator);
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public AgentBase merge(AgentBase transientObject) {
+ return defaultAgentService.merge(transientObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<AgentBase> listByTitle(Class<? extends AgentBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultAgentService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<AgentBase> page(Class<? extends AgentBase> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultAgentService.page(type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID refresh(AgentBase persistentObject) {
+ return defaultAgentService.refresh(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<AgentBase> listByReferenceTitle(Class<? extends AgentBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultAgentService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param tableName
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int)
+ */
+ @Override
+ public List<AgentBase> rows(String tableName, int limit, int start) {
+ return defaultAgentService.rows(tableName, limit, start);
+ }
+
+ /**
+ * @param newInstances
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, AgentBase> save(Collection<AgentBase> newInstances) {
+ return null;
+ }
+
+ /**
+ * @param newInstance
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID save(AgentBase newInstance) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID saveOrUpdate(AgentBase transientObject) {
+ return null;
+ }
+
+ /**
+ * @param transientObjects
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, AgentBase> saveOrUpdate(Collection<AgentBase> transientObjects) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID update(AgentBase transientObject) {
+ return defaultAgentService.update(transientObject);
+ }
+
+ /**
+ * @param example
+ * @param includeProperties
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<AgentBase> list(AgentBase example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultAgentService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param matchStrategy
+ * @param mergeStrategy
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy)
+ */
+ @Override
+ public int deduplicate(Class<? extends AgentBase> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) {
+ return defaultAgentService.deduplicate(clazz, matchStrategy, mergeStrategy);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param matchMode
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode)
+ */
+ @Override
+ public Pager<AgentBase> findTitleCache(Class<? extends AgentBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) {
+ return defaultAgentService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode);
+ };
+
+
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.transientServices;
+
+import java.util.List;
+
+import org.springframework.security.access.PermissionEvaluator;
+import org.springframework.security.authentication.ProviderManager;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.TransactionStatus;
+
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.service.IAgentService;
+import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.api.service.ICollectionService;
+import eu.etaxonomy.cdm.api.service.ICommonService;
+import eu.etaxonomy.cdm.api.service.IDatabaseService;
+import eu.etaxonomy.cdm.api.service.IDescriptionService;
+import eu.etaxonomy.cdm.api.service.IFeatureNodeService;
+import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
+import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService;
+import eu.etaxonomy.cdm.api.service.IGroupService;
+import eu.etaxonomy.cdm.api.service.IIdentificationKeyService;
+import eu.etaxonomy.cdm.api.service.ILocationService;
+import eu.etaxonomy.cdm.api.service.IMediaService;
+import eu.etaxonomy.cdm.api.service.INameService;
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
+import eu.etaxonomy.cdm.api.service.IReferenceService;
+import eu.etaxonomy.cdm.api.service.IService;
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.api.service.IUserService;
+import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.api.service.IWorkingSetService;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+
+/**
+ * @author pplitzner
+ * @date 26.09.2013
+ *
+ */
+public class TransientCdmRepository implements ICdmApplicationConfiguration {
+
+ private ICdmApplicationConfiguration defaultApplicationConfiguration;
+ private TransientOccurenceService occurenceService;
+
+ public List<SpecimenOrObservationBase> getUnits(){
+ return occurenceService.getUnits();
+ }
+
+ /**
+ * @param defaultApplicationConfiguration
+ */
+ public TransientCdmRepository(ICdmApplicationConfiguration defaultApplicationConfiguration) {
+ this.defaultApplicationConfiguration = defaultApplicationConfiguration;
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#NewConversation()
+ */
+ @Override
+ public ConversationHolder NewConversation() {
+ return defaultApplicationConfiguration.NewConversation();
+ }
+
+ /**
+ * @param arg0
+ * @param arg1
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#authenticate(java.lang.String, java.lang.String)
+ */
+ @Override
+ public void authenticate(String arg0, String arg1) {
+ defaultApplicationConfiguration.authenticate(arg0, arg1);
+ }
+
+ /**
+ * @param arg0
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#commitTransaction(org.springframework.transaction.TransactionStatus)
+ */
+ @Override
+ public void commitTransaction(TransactionStatus arg0) {
+ defaultApplicationConfiguration.commitTransaction(arg0);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAgentService()
+ */
+ @Override
+ public IAgentService getAgentService() {
+ return new TransientAgentService(defaultApplicationConfiguration.getAgentService());
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAuthenticationManager()
+ */
+ @Override
+ public ProviderManager getAuthenticationManager() {
+ return defaultApplicationConfiguration.getAuthenticationManager();
+ }
+
+ /**
+ * @param arg0
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getBean(java.lang.String)
+ */
+ @Override
+ public Object getBean(String arg0) {
+ return defaultApplicationConfiguration.getBean(arg0);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getClassificationService()
+ */
+ @Override
+ public IClassificationService getClassificationService() {
+ return new TransientClassificationService(defaultApplicationConfiguration.getClassificationService());
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getCollectionService()
+ */
+ @Override
+ public ICollectionService getCollectionService() {
+ return new TransientCollectionService(defaultApplicationConfiguration.getCollectionService());
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getCommonService()
+ */
+ @Override
+ public ICommonService getCommonService() {
+ return defaultApplicationConfiguration.getCommonService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getDatabaseService()
+ */
+ @Override
+ public IDatabaseService getDatabaseService() {
+ return defaultApplicationConfiguration.getDatabaseService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getDescriptionService()
+ */
+ @Override
+ public IDescriptionService getDescriptionService() {
+ return new TransientDescriptionService(defaultApplicationConfiguration.getDescriptionService());
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getFeatureNodeService()
+ */
+ @Override
+ public IFeatureNodeService getFeatureNodeService() {
+ return defaultApplicationConfiguration.getFeatureNodeService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getFeatureTreeService()
+ */
+ @Override
+ public IFeatureTreeService getFeatureTreeService() {
+ return defaultApplicationConfiguration.getFeatureTreeService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getGrantedAuthorityService()
+ */
+ @Override
+ public IGrantedAuthorityService getGrantedAuthorityService() {
+ return defaultApplicationConfiguration.getGrantedAuthorityService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getGroupService()
+ */
+ @Override
+ public IGroupService getGroupService() {
+ return defaultApplicationConfiguration.getGroupService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getIdentificationKeyService()
+ */
+ @Override
+ public IIdentificationKeyService getIdentificationKeyService() {
+ return defaultApplicationConfiguration.getIdentificationKeyService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getLocationService()
+ */
+ @Override
+ public ILocationService getLocationService() {
+ return defaultApplicationConfiguration.getLocationService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getMainService()
+ */
+ @Override
+ public IService<CdmBase> getMainService() {
+ return defaultApplicationConfiguration.getMainService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getMediaService()
+ */
+ @Override
+ public IMediaService getMediaService() {
+ return defaultApplicationConfiguration.getMediaService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getNameService()
+ */
+ @Override
+ public INameService getNameService() {
+ return new TransientNameService(defaultApplicationConfiguration.getNameService());
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getOccurrenceService()
+ */
+ @Override
+ public IOccurrenceService getOccurrenceService() {
+ if(occurenceService==null){
+ occurenceService = new TransientOccurenceService(defaultApplicationConfiguration.getOccurrenceService());
+ }
+ return occurenceService;
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPermissionEvaluator()
+ */
+ @Override
+ public PermissionEvaluator getPermissionEvaluator() {
+ return defaultApplicationConfiguration.getPermissionEvaluator();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPolytomousKeyNodeService()
+ */
+ @Override
+ public IPolytomousKeyNodeService getPolytomousKeyNodeService() {
+ return defaultApplicationConfiguration.getPolytomousKeyNodeService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPolytomousKeyService()
+ */
+ @Override
+ public IPolytomousKeyService getPolytomousKeyService() {
+ return defaultApplicationConfiguration.getPolytomousKeyService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getReferenceService()
+ */
+ @Override
+ public IReferenceService getReferenceService() {
+ return new TransientReferenceService(defaultApplicationConfiguration.getReferenceService());
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTaxonNodeService()
+ */
+ @Override
+ public ITaxonNodeService getTaxonNodeService() {
+ return defaultApplicationConfiguration.getTaxonNodeService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTaxonService()
+ */
+ @Override
+ public ITaxonService getTaxonService() {
+ return new TransientTaxonService(defaultApplicationConfiguration.getTaxonService());
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTermService()
+ */
+ @Override
+ public ITermService getTermService() {
+ return new TransientTermService(defaultApplicationConfiguration.getTermService());
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTransactionManager()
+ */
+ @Override
+ public PlatformTransactionManager getTransactionManager() {
+ return defaultApplicationConfiguration.getTransactionManager();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getUserService()
+ */
+ @Override
+ public IUserService getUserService() {
+ return defaultApplicationConfiguration.getUserService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getVocabularyService()
+ */
+ @Override
+ public IVocabularyService getVocabularyService() {
+ return defaultApplicationConfiguration.getVocabularyService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getWorkingSetService()
+ */
+ @Override
+ public IWorkingSetService getWorkingSetService() {
+ return defaultApplicationConfiguration.getWorkingSetService();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#startTransaction()
+ */
+ @Override
+ public TransactionStatus startTransaction() {
+ return defaultApplicationConfiguration.startTransaction();
+ }
+
+ /**
+ * @param arg0
+ * @return
+ * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#startTransaction(java.lang.Boolean)
+ */
+ @Override
+ public TransactionStatus startTransaction(Boolean arg0) {
+ return defaultApplicationConfiguration.startTransaction(arg0);
+ }
+
+
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.transientServices;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.hibernate.LockMode;
+import org.hibernate.Session;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.envers.query.criteria.AuditCriterion;
+
+import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.ISourceable;
+import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.common.LSID;
+import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
+import eu.etaxonomy.cdm.model.media.MediaRepresentation;
+import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.name.Rank;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.model.view.AuditEvent;
+import eu.etaxonomy.cdm.model.view.AuditEventRecord;
+import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.query.Grouping;
+import eu.etaxonomy.cdm.persistence.query.MatchMode;
+import eu.etaxonomy.cdm.persistence.query.OrderHint;
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+
+/**
+ * @author pplitzner
+ * @date 27.09.2013
+ *
+ */
+public class TransientClassificationService implements IClassificationService {
+
+ private IClassificationService defaultClassificationService;
+
+ /**
+ * @param defaultClassificationService
+ */
+ public TransientClassificationService(IClassificationService defaultClassificationService) {
+ this.defaultClassificationService = defaultClassificationService;
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<Classification>> pageAuditEvents(Classification t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultClassificationService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
+ }
+
+ /**
+ * @param annotatedObj
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Annotation> getAnnotations(Classification annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultClassificationService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#getTaxonNodeByUuid(java.util.UUID)
+ */
+ @Override
+ public TaxonNode getTaxonNodeByUuid(UUID uuid) {
+ return defaultClassificationService.getTaxonNodeByUuid(uuid);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#getTreeNodeByUuid(java.util.UUID)
+ */
+ @Override
+ public ITaxonTreeNode getTreeNodeByUuid(UUID uuid) {
+ return defaultClassificationService.getTreeNodeByUuid(uuid);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IService#clear()
+ */
+ @Override
+ public void clear() {
+ defaultClassificationService.clear();
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#listClassifications(java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Classification> listClassifications(Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultClassificationService.listClassifications(limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
+ */
+ @Override
+ public void lock(Classification t, LockMode lockMode) {
+ defaultClassificationService.lock(t, lockMode);
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @param propertyPaths
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
+ */
+ @Override
+ public void refresh(Classification t, LockMode lockMode, List<String> propertyPaths) {
+ defaultClassificationService.refresh(t, lockMode, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param classificationUuid
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadTaxonNodeByTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.UUID, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public TaxonNode loadTaxonNodeByTaxon(Taxon taxon, UUID classificationUuid, List<String> propertyPaths) {
+ return defaultClassificationService.loadTaxonNodeByTaxon(taxon, classificationUuid, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache()
+ */
+ @Override
+ public void updateTitleCache() {
+ defaultClassificationService.updateTitleCache();
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<Classification> getNextAuditEvent(Classification t) {
+ return defaultClassificationService.getNextAuditEvent(t);
+ }
+
+ /**
+ * @param annotatableEntity
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Marker> getMarkers(Classification annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultClassificationService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param stepSize
+ * @param cacheStrategy
+ * @param monitor
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor)
+ */
+ @Override
+ public void updateTitleCache(Class<? extends Classification> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<Classification> cacheStrategy, IProgressMonitor monitor) {
+ defaultClassificationService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor);
+ }
+
+ /**
+ * @param taxonNode
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadTaxonNode(eu.etaxonomy.cdm.model.taxon.TaxonNode, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public TaxonNode loadTaxonNode(TaxonNode taxonNode, List<String> propertyPaths) {
+ return defaultClassificationService.loadTaxonNode(taxonNode, propertyPaths);
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<Classification> getPreviousAuditEvent(Classification t) {
+ return defaultClassificationService.getPreviousAuditEvent(t);
+ }
+
+ /**
+ * @param classification
+ * @param rank
+ * @param limit
+ * @param start
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadRankSpecificRootNodes(eu.etaxonomy.cdm.model.taxon.Classification, eu.etaxonomy.cdm.model.name.Rank, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public List<TaxonNode> loadRankSpecificRootNodes(Classification classification, Rank rank, Integer limit, Integer start, List<String> propertyPaths) {
+ return defaultClassificationService.loadRankSpecificRootNodes(classification, rank, limit, start, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class)
+ */
+ @Override
+ public int count(Class<? extends Classification> clazz) {
+ return defaultClassificationService.count(clazz);
+ }
+
+ /**
+ * @param clazz
+ * @param from
+ * @param to
+ * @param criteria
+ * @param pageSize
+ * @param pageValue
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<Classification>> pageAuditEvents(Class<? extends Classification> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultClassificationService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths);
+ }
+
+ /**
+ * @param lsid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID)
+ */
+ @Override
+ public Classification find(LSID lsid) {
+ return defaultClassificationService.find(lsid);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID delete(Classification persistentObject) {
+ return defaultClassificationService.delete(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Object[]> groupMarkers(Class<? extends Classification> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultClassificationService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID)
+ */
+ @Override
+ public boolean exists(UUID uuid) {
+ return defaultClassificationService.exists(uuid);
+ }
+
+ /**
+ * @param x
+ * @param y
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
+ */
+ @Override
+ public Classification replace(Classification x, Classification y) {
+ return defaultClassificationService.replace(x, y);
+ }
+
+ /**
+ * @param uuidSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set)
+ */
+ @Override
+ public List<Classification> find(Set<UUID> uuidSet) {
+ return defaultClassificationService.find(uuidSet);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<IdentifiableSource> getSources(Classification t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultClassificationService.getSources(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param classification
+ * @param rank
+ * @param pageSize
+ * @param pageIndex
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#listRankSpecificRootNodes(eu.etaxonomy.cdm.model.taxon.Classification, eu.etaxonomy.cdm.model.name.Rank, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<TaxonNode> listRankSpecificRootNodes(Classification classification, Rank rank, Integer pageSize, Integer pageIndex, List<String> propertyPaths) {
+ return defaultClassificationService.listRankSpecificRootNodes(classification, rank, pageSize, pageIndex, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID)
+ */
+ @Override
+ public Classification find(UUID uuid) {
+ return defaultClassificationService.find(uuid);
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(int)
+ */
+ @Override
+ public Classification find(int id) {
+ return defaultClassificationService.find(id);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<Rights> getRights(Classification t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultClassificationService.getRights(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean)
+ */
+ @Override
+ public int countMarkers(Class<? extends Classification> clazz, Boolean technical) {
+ return defaultClassificationService.countMarkers(clazz, technical);
+ }
+
+ /**
+ * @param idSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set)
+ */
+ @Override
+ public List<Classification> findById(Set<Integer> idSet) {
+ return defaultClassificationService.findById(idSet);
+ }
+
+ /**
+ * @param clazz
+ * @param idInSource
+ * @param idNamespace
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String)
+ */
+ @Override
+ public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
+ return defaultClassificationService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace);
+ }
+
+ /**
+ * @param classification
+ * @param rank
+ * @param pageSize
+ * @param pageIndex
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#pageRankSpecificRootNodes(eu.etaxonomy.cdm.model.taxon.Classification, eu.etaxonomy.cdm.model.name.Rank, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<TaxonNode> pageRankSpecificRootNodes(Classification classification, Rank rank, Integer pageSize, Integer pageIndex, List<String> propertyPaths) {
+ return defaultClassificationService.pageRankSpecificRootNodes(classification, rank, pageSize, pageIndex, propertyPaths);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#getSession()
+ */
+ @Override
+ public Session getSession() {
+ return defaultClassificationService.getSession();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<Classification>> getUuidAndTitleCache() {
+ return defaultClassificationService.getUuidAndTitleCache();
+ }
+
+ /**
+ * @param clazz
+ * @param limit
+ * @param start
+ * @param groups
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Object[]> group(Class<? extends Classification> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) {
+ return defaultClassificationService.group(clazz, limit, start, groups, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Classification> findByTitle(Class<? extends Classification> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultClassificationService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxonNode
+ * @param baseRank
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadTreeBranch(eu.etaxonomy.cdm.model.taxon.TaxonNode, eu.etaxonomy.cdm.model.name.Rank, java.util.List)
+ */
+ @Override
+ public List<TaxonNode> loadTreeBranch(TaxonNode taxonNode, Rank baseRank, List<String> propertyPaths) {
+ return defaultClassificationService.loadTreeBranch(taxonNode, baseRank, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Classification> list(Class<? extends Classification> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultClassificationService.list(type, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param classification
+ * @param baseRank
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadTreeBranchToTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.Classification, eu.etaxonomy.cdm.model.name.Rank, java.util.List)
+ */
+ @Override
+ public List<TaxonNode> loadTreeBranchToTaxon(Taxon taxon, Classification classification, Rank baseRank, List<String> propertyPaths) {
+ return defaultClassificationService.loadTreeBranchToTaxon(taxon, classification, baseRank, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Pager<Classification> findByTitle(IIdentifiableEntityServiceConfigurator<Classification> configurator) {
+ return defaultClassificationService.findByTitle(configurator);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
+ */
+ @Override
+ public Integer countByTitle(Class<? extends Classification> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) {
+ return defaultClassificationService.countByTitle(clazz, queryString, matchmode, criteria);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID)
+ */
+ @Override
+ public Classification load(UUID uuid) {
+ return defaultClassificationService.load(uuid);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List)
+ */
+ @Override
+ public Classification load(UUID uuid, List<String> propertyPaths) {
+ return defaultClassificationService.load(uuid, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Integer countByTitle(IIdentifiableEntityServiceConfigurator<Classification> configurator) {
+ return defaultClassificationService.countByTitle(configurator);
+ }
+
+ /**
+ * @param taxon
+ * @param classification
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadChildNodesOfTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.Classification, java.util.List)
+ */
+ @Override
+ public List<TaxonNode> loadChildNodesOfTaxon(Taxon taxon, Classification classification, List<String> propertyPaths) {
+ return defaultClassificationService.loadChildNodesOfTaxon(taxon, classification, propertyPaths);
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public Classification merge(Classification transientObject) {
+ return defaultClassificationService.merge(transientObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Classification> listByTitle(Class<? extends Classification> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultClassificationService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Classification> page(Class<? extends Classification> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultClassificationService.page(type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxonNode
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadChildNodesOfTaxonNode(eu.etaxonomy.cdm.model.taxon.TaxonNode, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public List<TaxonNode> loadChildNodesOfTaxonNode(TaxonNode taxonNode, List<String> propertyPaths) {
+ return defaultClassificationService.loadChildNodesOfTaxonNode(taxonNode, propertyPaths);
+ }
+
+ /**
+ * @param classification
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(eu.etaxonomy.cdm.model.taxon.Classification)
+ */
+ @Override
+ public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification) {
+ return defaultClassificationService.getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(classification);
+ }
+
+ /**
+ * @param taxon
+ * @param taxTree
+ * @param propertyPaths
+ * @param size
+ * @param height
+ * @param widthOrDuration
+ * @param mimeTypes
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#getAllMediaForChildNodes(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.Classification, java.util.List, int, int, int, java.lang.String[])
+ */
+ @Deprecated
+ @Override
+ public Map<UUID, List<MediaRepresentation>> getAllMediaForChildNodes(Taxon taxon, Classification taxTree, List<String> propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes) {
+ return defaultClassificationService.getAllMediaForChildNodes(taxon, taxTree, propertyPaths, size, height, widthOrDuration, mimeTypes);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID refresh(Classification persistentObject) {
+ return defaultClassificationService.refresh(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Classification> listByReferenceTitle(Class<? extends Classification> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultClassificationService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxonNode
+ * @param propertyPaths
+ * @param size
+ * @param height
+ * @param widthOrDuration
+ * @param mimeTypes
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#getAllMediaForChildNodes(eu.etaxonomy.cdm.model.taxon.TaxonNode, java.util.List, int, int, int, java.lang.String[])
+ */
+ @Override
+ public Map<UUID, List<MediaRepresentation>> getAllMediaForChildNodes(TaxonNode taxonNode, List<String> propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes) {
+ return defaultClassificationService.getAllMediaForChildNodes(taxonNode, propertyPaths, size, height, widthOrDuration, mimeTypes);
+ }
+
+ /**
+ * @param tableName
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int)
+ */
+ @Override
+ public List<Classification> rows(String tableName, int limit, int start) {
+ return defaultClassificationService.rows(tableName, limit, start);
+ }
+
+ /**
+ * @param newInstances
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, Classification> save(Collection<Classification> newInstances) {
+ return null;
+ }
+
+ /**
+ * @param taxonNode
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#removeTaxonNode(eu.etaxonomy.cdm.model.taxon.TaxonNode)
+ */
+ @Deprecated
+ @Override
+ public UUID removeTaxonNode(TaxonNode taxonNode) {
+ return defaultClassificationService.removeTaxonNode(taxonNode);
+ }
+
+ /**
+ * @param taxonNode
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#saveTaxonNode(eu.etaxonomy.cdm.model.taxon.TaxonNode)
+ */
+ @Deprecated
+ @Override
+ public UUID saveTaxonNode(TaxonNode taxonNode) {
+ return null;
+ }
+
+ /**
+ * @param newInstance
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID save(Classification newInstance) {
+ return null;
+ }
+
+ /**
+ * @param taxonNodeCollection
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#saveTaxonNodeAll(java.util.Collection)
+ */
+ @Deprecated
+ @Override
+ public Map<UUID, TaxonNode> saveTaxonNodeAll(Collection<TaxonNode> taxonNodeCollection) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID saveOrUpdate(Classification transientObject) {
+ return null;
+ }
+
+ /**
+ * @param treeNode
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#removeTreeNode(eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode)
+ */
+ @Override
+ public UUID removeTreeNode(ITaxonTreeNode treeNode) {
+ return defaultClassificationService.removeTreeNode(treeNode);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Classification> search(Class<? extends Classification> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultClassificationService.search(clazz, queryString, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param treeNode
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#saveTreeNode(eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode)
+ */
+ @Override
+ public UUID saveTreeNode(ITaxonTreeNode treeNode) {
+ return null;
+ }
+
+ /**
+ * @param transientObjects
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, Classification> saveOrUpdate(Collection<Classification> transientObjects) {
+ return null;
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IClassificationService#getAllNodes()
+ */
+ @Override
+ public List<TaxonNode> getAllNodes() {
+ return defaultClassificationService.getAllNodes();
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID update(Classification transientObject) {
+ return defaultClassificationService.update(transientObject);
+ }
+
+ /**
+ * @param example
+ * @param includeProperties
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Classification> list(Classification example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultClassificationService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param matchStrategy
+ * @param mergeStrategy
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy)
+ */
+ @Override
+ public int deduplicate(Class<? extends Classification> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) {
+ return defaultClassificationService.deduplicate(clazz, matchStrategy, mergeStrategy);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param matchMode
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode)
+ */
+ @Override
+ public Pager<Classification> findTitleCache(Class<? extends Classification> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) {
+ return defaultClassificationService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode);
+ }
+
+
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.transientServices;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.hibernate.LockMode;
+import org.hibernate.Session;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.envers.query.criteria.AuditCriterion;
+
+import eu.etaxonomy.cdm.api.service.ICollectionService;
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.ISourceable;
+import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.common.LSID;
+import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
+import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.occurrence.Collection;
+import eu.etaxonomy.cdm.model.view.AuditEvent;
+import eu.etaxonomy.cdm.model.view.AuditEventRecord;
+import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.query.Grouping;
+import eu.etaxonomy.cdm.persistence.query.MatchMode;
+import eu.etaxonomy.cdm.persistence.query.OrderHint;
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+
+/**
+ * @author pplitzner
+ * @date 27.09.2013
+ *
+ */
+public class TransientCollectionService implements ICollectionService {
+
+ private ICollectionService defaultCollectionService;
+
+ /**
+ * @param defaultCollectionService
+ */
+ public TransientCollectionService(ICollectionService defaultCollectionService) {
+ this.defaultCollectionService = defaultCollectionService;
+ }
+
+ /**
+ * @param clazz
+ * @param query
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ICollectionService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Collection> search(Class<? extends Collection> clazz, String query, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultCollectionService.search(clazz, query, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<Collection>> pageAuditEvents(Collection t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultCollectionService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
+ }
+
+ /**
+ * @param annotatedObj
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Annotation> getAnnotations(Collection annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultCollectionService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IService#clear()
+ */
+ @Override
+ public void clear() {
+ defaultCollectionService.clear();
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
+ */
+ @Override
+ public void lock(Collection t, LockMode lockMode) {
+ defaultCollectionService.lock(t, lockMode);
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @param propertyPaths
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
+ */
+ @Override
+ public void refresh(Collection t, LockMode lockMode, List<String> propertyPaths) {
+ defaultCollectionService.refresh(t, lockMode, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache()
+ */
+ @Override
+ public void updateTitleCache() {
+ defaultCollectionService.updateTitleCache();
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<Collection> getNextAuditEvent(Collection t) {
+ return defaultCollectionService.getNextAuditEvent(t);
+ }
+
+ /**
+ * @param code
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ICollectionService#searchByCode(java.lang.String)
+ */
+ @Override
+ public List<Collection> searchByCode(String code) {
+ return defaultCollectionService.searchByCode(code);
+ }
+
+ /**
+ * @param annotatableEntity
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Marker> getMarkers(Collection annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultCollectionService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param stepSize
+ * @param cacheStrategy
+ * @param monitor
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor)
+ */
+ @Override
+ public void updateTitleCache(Class<? extends Collection> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<Collection> cacheStrategy, IProgressMonitor monitor) {
+ defaultCollectionService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor);
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<Collection> getPreviousAuditEvent(Collection t) {
+ return defaultCollectionService.getPreviousAuditEvent(t);
+ }
+
+ /**
+ * @param clazz
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class)
+ */
+ @Override
+ public int count(Class<? extends Collection> clazz) {
+ return defaultCollectionService.count(clazz);
+ }
+
+ /**
+ * @param clazz
+ * @param from
+ * @param to
+ * @param criteria
+ * @param pageSize
+ * @param pageValue
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<Collection>> pageAuditEvents(Class<? extends Collection> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultCollectionService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths);
+ }
+
+ /**
+ * @param lsid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID)
+ */
+ @Override
+ public Collection find(LSID lsid) {
+ return defaultCollectionService.find(lsid);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID delete(Collection persistentObject) {
+ return defaultCollectionService.delete(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Object[]> groupMarkers(Class<? extends Collection> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultCollectionService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID)
+ */
+ @Override
+ public boolean exists(UUID uuid) {
+ return defaultCollectionService.exists(uuid);
+ }
+
+ /**
+ * @param x
+ * @param y
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
+ */
+ @Override
+ public Collection replace(Collection x, Collection y) {
+ return defaultCollectionService.replace(x, y);
+ }
+
+ /**
+ * @param uuidSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set)
+ */
+ @Override
+ public List<Collection> find(Set<UUID> uuidSet) {
+ return defaultCollectionService.find(uuidSet);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<IdentifiableSource> getSources(Collection t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultCollectionService.getSources(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID)
+ */
+ @Override
+ public Collection find(UUID uuid) {
+ return defaultCollectionService.find(uuid);
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(int)
+ */
+ @Override
+ public Collection find(int id) {
+ return defaultCollectionService.find(id);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<Rights> getRights(Collection t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultCollectionService.getRights(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean)
+ */
+ @Override
+ public int countMarkers(Class<? extends Collection> clazz, Boolean technical) {
+ return defaultCollectionService.countMarkers(clazz, technical);
+ }
+
+ /**
+ * @param idSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set)
+ */
+ @Override
+ public List<Collection> findById(Set<Integer> idSet) {
+ return defaultCollectionService.findById(idSet);
+ }
+
+ /**
+ * @param clazz
+ * @param idInSource
+ * @param idNamespace
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String)
+ */
+ @Override
+ public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
+ return defaultCollectionService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#getSession()
+ */
+ @Override
+ public Session getSession() {
+ return defaultCollectionService.getSession();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<Collection>> getUuidAndTitleCache() {
+ return defaultCollectionService.getUuidAndTitleCache();
+ }
+
+ /**
+ * @param clazz
+ * @param limit
+ * @param start
+ * @param groups
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Object[]> group(Class<? extends Collection> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) {
+ return defaultCollectionService.group(clazz, limit, start, groups, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Collection> findByTitle(Class<? extends Collection> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultCollectionService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Collection> list(Class<? extends Collection> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultCollectionService.list(type, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Pager<Collection> findByTitle(IIdentifiableEntityServiceConfigurator<Collection> configurator) {
+ return defaultCollectionService.findByTitle(configurator);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
+ */
+ @Override
+ public Integer countByTitle(Class<? extends Collection> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) {
+ return defaultCollectionService.countByTitle(clazz, queryString, matchmode, criteria);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID)
+ */
+ @Override
+ public Collection load(UUID uuid) {
+ return defaultCollectionService.load(uuid);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List)
+ */
+ @Override
+ public Collection load(UUID uuid, List<String> propertyPaths) {
+ return defaultCollectionService.load(uuid, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Integer countByTitle(IIdentifiableEntityServiceConfigurator<Collection> configurator) {
+ return defaultCollectionService.countByTitle(configurator);
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public Collection merge(Collection transientObject) {
+ return defaultCollectionService.merge(transientObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Collection> listByTitle(Class<? extends Collection> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultCollectionService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Collection> page(Class<? extends Collection> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultCollectionService.page(type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID refresh(Collection persistentObject) {
+ return defaultCollectionService.refresh(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Collection> listByReferenceTitle(Class<? extends Collection> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultCollectionService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param tableName
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int)
+ */
+ @Override
+ public List<Collection> rows(String tableName, int limit, int start) {
+ return defaultCollectionService.rows(tableName, limit, start);
+ }
+
+ /**
+ * @param newInstances
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, Collection> save(java.util.Collection<Collection> newInstances) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID save(Collection newInstance) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID saveOrUpdate(Collection transientObject) {
+ return null;
+ }
+
+ /**
+ * @param transientObjects
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, Collection> saveOrUpdate(java.util.Collection<Collection> transientObjects) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID update(Collection transientObject) {
+ return defaultCollectionService.update(transientObject);
+ }
+
+ /**
+ * @param example
+ * @param includeProperties
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Collection> list(Collection example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultCollectionService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param matchStrategy
+ * @param mergeStrategy
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy)
+ */
+ @Override
+ public int deduplicate(Class<? extends Collection> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) {
+ return defaultCollectionService.deduplicate(clazz, matchStrategy, mergeStrategy);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param matchMode
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode)
+ */
+ @Override
+ public Pager<Collection> findTitleCache(Class<? extends Collection> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) {
+ return defaultCollectionService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode);
+ }
+
+
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.transientServices;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.hibernate.LockMode;
+import org.hibernate.Session;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.envers.query.criteria.AuditCriterion;
+
+import eu.etaxonomy.cdm.api.service.DistributionTree;
+import eu.etaxonomy.cdm.api.service.IDescriptionService;
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.cdm.model.common.ISourceable;
+import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.common.LSID;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.FeatureTree;
+import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
+import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.view.AuditEvent;
+import eu.etaxonomy.cdm.model.view.AuditEventRecord;
+import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.query.Grouping;
+import eu.etaxonomy.cdm.persistence.query.MatchMode;
+import eu.etaxonomy.cdm.persistence.query.OrderHint;
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+
+/**
+ * @author pplitzner
+ * @date 27.09.2013
+ *
+ */
+public class TransientDescriptionService implements IDescriptionService {
+
+ private IDescriptionService defaultDescriptionService;
+
+ /**
+ * @param defaultDescriptionService
+ */
+ public TransientDescriptionService(IDescriptionService defaultDescriptionService) {
+ this.defaultDescriptionService = defaultDescriptionService;
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<DescriptionBase>> pageAuditEvents(DescriptionBase t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultDescriptionService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
+ }
+
+ /**
+ * @param annotatedObj
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Annotation> getAnnotations(DescriptionBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IService#clear()
+ */
+ @Override
+ public void clear() {
+ defaultDescriptionService.clear();
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
+ */
+ @Override
+ public void lock(DescriptionBase t, LockMode lockMode) {
+ defaultDescriptionService.lock(t, lockMode);
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @param propertyPaths
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
+ */
+ @Override
+ public void refresh(DescriptionBase t, LockMode lockMode, List<String> propertyPaths) {
+ defaultDescriptionService.refresh(t, lockMode, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache()
+ */
+ @Override
+ public void updateTitleCache() {
+ defaultDescriptionService.updateTitleCache();
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<DescriptionBase> getNextAuditEvent(DescriptionBase t) {
+ return defaultDescriptionService.getNextAuditEvent(t);
+ }
+
+ /**
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#getDefaultFeatureVocabulary()
+ */
+ @Deprecated
+ @Override
+ public TermVocabulary<Feature> getDefaultFeatureVocabulary() {
+ return defaultDescriptionService.getDefaultFeatureVocabulary();
+ }
+
+ /**
+ * @param annotatableEntity
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Marker> getMarkers(DescriptionBase annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#getFeatureVocabulary(java.util.UUID)
+ */
+ @Deprecated
+ @Override
+ public TermVocabulary<Feature> getFeatureVocabulary(UUID uuid) {
+ return defaultDescriptionService.getFeatureVocabulary(uuid);
+ }
+
+ /**
+ * @param clazz
+ * @param stepSize
+ * @param cacheStrategy
+ * @param monitor
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor)
+ */
+ @Override
+ public void updateTitleCache(Class<? extends DescriptionBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<DescriptionBase> cacheStrategy, IProgressMonitor monitor) {
+ defaultDescriptionService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor);
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<DescriptionBase> getPreviousAuditEvent(DescriptionBase t) {
+ return defaultDescriptionService.getPreviousAuditEvent(t);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#getDescriptionElementByUuid(java.util.UUID)
+ */
+ @Override
+ public DescriptionElementBase getDescriptionElementByUuid(UUID uuid) {
+ return defaultDescriptionService.getDescriptionElementByUuid(uuid);
+ }
+
+ /**
+ * @param clazz
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class)
+ */
+ @Override
+ public int count(Class<? extends DescriptionBase> clazz) {
+ return defaultDescriptionService.count(clazz);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#loadDescriptionElement(java.util.UUID, java.util.List)
+ */
+ @Override
+ public DescriptionElementBase loadDescriptionElement(UUID uuid, List<String> propertyPaths) {
+ return defaultDescriptionService.loadDescriptionElement(uuid, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param from
+ * @param to
+ * @param criteria
+ * @param pageSize
+ * @param pageValue
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<DescriptionBase>> pageAuditEvents(Class<? extends DescriptionBase> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultDescriptionService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths);
+ }
+
+ /**
+ * @param lsid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID)
+ */
+ @Override
+ public DescriptionBase find(LSID lsid) {
+ return defaultDescriptionService.find(lsid);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID delete(DescriptionBase persistentObject) {
+ return defaultDescriptionService.delete(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Object[]> groupMarkers(Class<? extends DescriptionBase> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID)
+ */
+ @Override
+ public boolean exists(UUID uuid) {
+ return defaultDescriptionService.exists(uuid);
+ }
+
+ /**
+ * @param x
+ * @param y
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
+ */
+ @Override
+ public DescriptionBase replace(DescriptionBase x, DescriptionBase y) {
+ return defaultDescriptionService.replace(x, y);
+ }
+
+ /**
+ * @param descriptionElement
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#saveDescriptionElement(eu.etaxonomy.cdm.model.description.DescriptionElementBase)
+ */
+ @Override
+ public UUID saveDescriptionElement(DescriptionElementBase descriptionElement) {
+ return null;
+ }
+
+ /**
+ * @param uuidSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set)
+ */
+ @Override
+ public List<DescriptionBase> find(Set<UUID> uuidSet) {
+ return defaultDescriptionService.find(uuidSet);
+ }
+
+ /**
+ * @param descriptionElements
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#saveDescriptionElement(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, DescriptionElementBase> saveDescriptionElement(Collection<DescriptionElementBase> descriptionElements) {
+ return null;
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<IdentifiableSource> getSources(DescriptionBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.getSources(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param descriptionElement
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#deleteDescriptionElement(eu.etaxonomy.cdm.model.description.DescriptionElementBase)
+ */
+ @Override
+ public UUID deleteDescriptionElement(DescriptionElementBase descriptionElement) {
+ return defaultDescriptionService.deleteDescriptionElement(descriptionElement);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID)
+ */
+ @Override
+ public DescriptionBase find(UUID uuid) {
+ return defaultDescriptionService.find(uuid);
+ }
+
+ /**
+ * @param type
+ * @param hasMedia
+ * @param hasText
+ * @param feature
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#page(java.lang.Class, java.lang.Boolean, java.lang.Boolean, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<DescriptionBase> page(Class<? extends DescriptionBase> type, Boolean hasMedia, Boolean hasText, Set<Feature> feature, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.page(type, hasMedia, hasText, feature, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(int)
+ */
+ @Override
+ public DescriptionBase find(int id) {
+ return defaultDescriptionService.find(id);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<Rights> getRights(DescriptionBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.getRights(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean)
+ */
+ @Override
+ public int countMarkers(Class<? extends DescriptionBase> clazz, Boolean technical) {
+ return defaultDescriptionService.countMarkers(clazz, technical);
+ }
+
+ /**
+ * @param idSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set)
+ */
+ @Override
+ public List<DescriptionBase> findById(Set<Integer> idSet) {
+ return defaultDescriptionService.findById(idSet);
+ }
+
+ /**
+ * @param clazz
+ * @param idInSource
+ * @param idNamespace
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String)
+ */
+ @Override
+ public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
+ return defaultDescriptionService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#getSession()
+ */
+ @Override
+ public Session getSession() {
+ return defaultDescriptionService.getSession();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<DescriptionBase>> getUuidAndTitleCache() {
+ return defaultDescriptionService.getUuidAndTitleCache();
+ }
+
+ /**
+ * @param clazz
+ * @param limit
+ * @param start
+ * @param groups
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Object[]> group(Class<? extends DescriptionBase> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) {
+ return defaultDescriptionService.group(clazz, limit, start, groups, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param hasImages
+ * @param hasText
+ * @param feature
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#count(java.lang.Class, java.lang.Boolean, java.lang.Boolean, java.util.Set)
+ */
+ @Override
+ public int count(Class<? extends DescriptionBase> type, Boolean hasImages, Boolean hasText, Set<Feature> feature) {
+ return defaultDescriptionService.count(type, hasImages, hasText, feature);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<DescriptionBase> findByTitle(Class<? extends DescriptionBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<DescriptionBase> list(Class<? extends DescriptionBase> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.list(type, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param description
+ * @param features
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#getDescriptionElements(eu.etaxonomy.cdm.model.description.DescriptionBase, java.util.Set, java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public Pager<DescriptionElementBase> getDescriptionElements(DescriptionBase description, Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.getDescriptionElements(description, features, type, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Pager<DescriptionBase> findByTitle(IIdentifiableEntityServiceConfigurator<DescriptionBase> configurator) {
+ return defaultDescriptionService.findByTitle(configurator);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
+ */
+ @Override
+ public Integer countByTitle(Class<? extends DescriptionBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) {
+ return defaultDescriptionService.countByTitle(clazz, queryString, matchmode, criteria);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID)
+ */
+ @Override
+ public DescriptionBase load(UUID uuid) {
+ return defaultDescriptionService.load(uuid);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List)
+ */
+ @Override
+ public DescriptionBase load(UUID uuid, List<String> propertyPaths) {
+ return defaultDescriptionService.load(uuid, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Integer countByTitle(IIdentifiableEntityServiceConfigurator<DescriptionBase> configurator) {
+ return defaultDescriptionService.countByTitle(configurator);
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public DescriptionBase merge(DescriptionBase transientObject) {
+ return defaultDescriptionService.merge(transientObject);
+ }
+
+ /**
+ * @param description
+ * @param descriptionType
+ * @param features
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#pageDescriptionElements(eu.etaxonomy.cdm.model.description.DescriptionBase, java.lang.Class, java.util.Set, java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<DescriptionElementBase> pageDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType, Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.pageDescriptionElements(description, descriptionType, features, type, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<DescriptionBase> listByTitle(Class<? extends DescriptionBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<DescriptionBase> page(Class<? extends DescriptionBase> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.page(type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID refresh(DescriptionBase persistentObject) {
+ return defaultDescriptionService.refresh(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<DescriptionBase> listByReferenceTitle(Class<? extends DescriptionBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param description
+ * @param features
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#listDescriptionElements(eu.etaxonomy.cdm.model.description.DescriptionBase, java.util.Set, java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public List<DescriptionElementBase> listDescriptionElements(DescriptionBase description, Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.listDescriptionElements(description, features, type, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param tableName
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int)
+ */
+ @Override
+ public List<DescriptionBase> rows(String tableName, int limit, int start) {
+ return defaultDescriptionService.rows(tableName, limit, start);
+ }
+
+ /**
+ * @param newInstances
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, DescriptionBase> save(Collection<DescriptionBase> newInstances) {
+ return null;
+ }
+
+ /**
+ * @param newInstance
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID save(DescriptionBase newInstance) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID saveOrUpdate(DescriptionBase transientObject) {
+ return null;
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<DescriptionBase> search(Class<? extends DescriptionBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.search(clazz, queryString, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param transientObjects
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, DescriptionBase> saveOrUpdate(Collection<DescriptionBase> transientObjects) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID update(DescriptionBase transientObject) {
+ return defaultDescriptionService.update(transientObject);
+ }
+
+ /**
+ * @param description
+ * @param descriptionType
+ * @param features
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#listDescriptionElements(eu.etaxonomy.cdm.model.description.DescriptionBase, java.lang.Class, java.util.Set, java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<DescriptionElementBase> listDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType, Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.listDescriptionElements(description, descriptionType, features, type, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param example
+ * @param includeProperties
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<DescriptionBase> list(DescriptionBase example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param matchStrategy
+ * @param mergeStrategy
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy)
+ */
+ @Override
+ public int deduplicate(Class<? extends DescriptionBase> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) {
+ return defaultDescriptionService.deduplicate(clazz, matchStrategy, mergeStrategy);
+ }
+
+ /**
+ * @param annotatedObj
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#getDescriptionElementAnnotations(eu.etaxonomy.cdm.model.description.DescriptionElementBase, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Annotation> getDescriptionElementAnnotations(DescriptionElementBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.getDescriptionElementAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param matchMode
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode)
+ */
+ @Override
+ public Pager<DescriptionBase> findTitleCache(Class<? extends DescriptionBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) {
+ return defaultDescriptionService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode);
+ }
+
+ /**
+ * @param taxon
+ * @param scopes
+ * @param geographicalScope
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#pageTaxonDescriptions(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.pageTaxonDescriptions(taxon, scopes, geographicalScope, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param scopes
+ * @param geographicalScope
+ * @param markerTypes
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#pageTaxonDescriptions(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.util.Set, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.pageTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param scopes
+ * @param geographicalScope
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#listTaxonDescriptions(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.listTaxonDescriptions(taxon, scopes, geographicalScope, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param scopes
+ * @param geographicalScope
+ * @param markerTypes
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#listTaxonDescriptions(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.util.Set, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.listTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param taxonUuid
+ * @param limitToGalleries
+ * @param markerTypes
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#listTaxonDescriptionMedia(java.util.UUID, boolean, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Media> listTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.listTaxonDescriptionMedia(taxonUuid, limitToGalleries, markerTypes, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param taxonUuid
+ * @param limitToGalleries
+ * @param markerTypes
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#countTaxonDescriptionMedia(java.util.UUID, boolean, java.util.Set)
+ */
+ @Override
+ public int countTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes) {
+ return defaultDescriptionService.countTaxonDescriptionMedia(taxonUuid, limitToGalleries, markerTypes);
+ }
+
+ /**
+ * @param name
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#getTaxonNameDescriptions(eu.etaxonomy.cdm.model.name.TaxonNameBase, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<TaxonNameDescription> getTaxonNameDescriptions(TaxonNameBase name, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.getTaxonNameDescriptions(name, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param namedAreas
+ * @param presence
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#searchDescriptionByDistribution(java.util.Set, eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonDescription> searchDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTermBase presence, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.searchDescriptionByDistribution(namedAreas, presence, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#searchElements(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<DescriptionElementBase> searchElements(Class<? extends DescriptionElementBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultDescriptionService.searchElements(clazz, queryString, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param descriptionElement
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#getMedia(eu.etaxonomy.cdm.model.description.DescriptionElementBase, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<Media> getMedia(DescriptionElementBase descriptionElement, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.getMedia(descriptionElement, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param features
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#getDescriptionElementsForTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public <T extends DescriptionElementBase> List<T> getDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.getDescriptionElementsForTaxon(taxon, features, type, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param features
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#listDescriptionElementsForTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public <T extends DescriptionElementBase> List<T> listDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.listDescriptionElementsForTaxon(taxon, features, type, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param features
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#pageDescriptionElementsForTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public <T extends DescriptionElementBase> Pager<T> pageDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.pageDescriptionElementsForTaxon(taxon, features, type, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param taxonDescriptions
+ * @param levels
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#getOrderedDistributions(java.util.Set, java.util.Set, java.util.List)
+ */
+ @Override
+ public DistributionTree getOrderedDistributions(Set<TaxonDescription> taxonDescriptions, Set<NamedAreaLevel> levels, List<String> propertyPaths) {
+ return defaultDescriptionService.getOrderedDistributions(taxonDescriptions, levels, propertyPaths);
+ }
+
+ /**
+ * @param featureTree
+ * @param description
+ * @param preferredLanguages
+ * @param separator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#generateNaturalLanguageDescription(eu.etaxonomy.cdm.model.description.FeatureTree, eu.etaxonomy.cdm.model.description.TaxonDescription, java.util.List, java.lang.String)
+ */
+ @Override
+ public String generateNaturalLanguageDescription(FeatureTree featureTree, TaxonDescription description, List<Language> preferredLanguages, String separator) {
+ return defaultDescriptionService.generateNaturalLanguageDescription(featureTree, description, preferredLanguages, separator);
+ }
+
+ /**
+ * @param description
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#hasStructuredData(eu.etaxonomy.cdm.model.description.DescriptionBase)
+ */
+ @Deprecated
+ @Override
+ public boolean hasStructuredData(DescriptionBase<?> description) {
+ return defaultDescriptionService.hasStructuredData(description);
+ }
+
+ /**
+ * @param descriptionElements
+ * @param targetDescription
+ * @param isPaste
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#moveDescriptionElementsToDescription(java.util.Collection, eu.etaxonomy.cdm.model.description.DescriptionBase, boolean)
+ */
+ @Override
+ public void moveDescriptionElementsToDescription(Collection<DescriptionElementBase> descriptionElements, DescriptionBase targetDescription, boolean isPaste) {
+ defaultDescriptionService.moveDescriptionElementsToDescription(descriptionElements, targetDescription, isPaste);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#pageNamedAreasInUse(java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<NamedArea> pageNamedAreasInUse(Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultDescriptionService.pageNamedAreasInUse(pageSize, pageNumber, propertyPaths);
+ }
+
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.transientServices;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.lucene.index.CorruptIndexException;
+import org.apache.lucene.queryParser.ParseException;
+import org.hibernate.LockMode;
+import org.hibernate.Session;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.envers.query.criteria.AuditCriterion;
+
+import eu.etaxonomy.cdm.api.service.INameService;
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
+import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.api.service.search.DocumentSearchResult;
+import eu.etaxonomy.cdm.api.service.search.SearchResult;
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.ISourceable;
+import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.common.LSID;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;
+import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
+import eu.etaxonomy.cdm.model.common.RelationshipBase;
+import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
+import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
+import eu.etaxonomy.cdm.model.name.HybridRelationship;
+import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
+import eu.etaxonomy.cdm.model.name.NameRelationship;
+import eu.etaxonomy.cdm.model.name.NameRelationshipType;
+import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
+import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
+import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.cdm.model.name.Rank;
+import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
+import eu.etaxonomy.cdm.model.view.AuditEvent;
+import eu.etaxonomy.cdm.model.view.AuditEventRecord;
+import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.query.Grouping;
+import eu.etaxonomy.cdm.persistence.query.MatchMode;
+import eu.etaxonomy.cdm.persistence.query.OrderHint;
+import eu.etaxonomy.cdm.strategy.cache.TaggedText;
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+
+/**
+ * @author pplitzner
+ * @date 27.09.2013
+ *
+ */
+public class TransientNameService implements INameService {
+
+ private INameService defaultNameService;
+
+ /**
+ *
+ */
+ public TransientNameService(INameService defaultNameService) {
+ this.defaultNameService = defaultNameService;
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<TaxonNameBase>> pageAuditEvents(TaxonNameBase t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultNameService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
+ }
+
+ /**
+ * @param annotatedObj
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Annotation> getAnnotations(TaxonNameBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IService#clear()
+ */
+ @Override
+ public void clear() {
+ defaultNameService.clear();
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
+ */
+ @Override
+ public void lock(TaxonNameBase t, LockMode lockMode) {
+ defaultNameService.lock(t, lockMode);
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @param propertyPaths
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
+ */
+ @Override
+ public void refresh(TaxonNameBase t, LockMode lockMode, List<String> propertyPaths) {
+ defaultNameService.refresh(t, lockMode, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache()
+ */
+ @Override
+ public void updateTitleCache() {
+ defaultNameService.updateTitleCache();
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<TaxonNameBase> getNextAuditEvent(TaxonNameBase t) {
+ return defaultNameService.getNextAuditEvent(t);
+ }
+
+ /**
+ * @param annotatableEntity
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Marker> getMarkers(TaxonNameBase annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param stepSize
+ * @param cacheStrategy
+ * @param monitor
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor)
+ */
+ @Override
+ public void updateTitleCache(Class<? extends TaxonNameBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<TaxonNameBase> cacheStrategy, IProgressMonitor monitor) {
+ defaultNameService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor);
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<TaxonNameBase> getPreviousAuditEvent(TaxonNameBase t) {
+ return defaultNameService.getPreviousAuditEvent(t);
+ }
+
+ /**
+ * @param clazz
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class)
+ */
+ @Override
+ public int count(Class<? extends TaxonNameBase> clazz) {
+ return defaultNameService.count(clazz);
+ }
+
+ /**
+ * @param name
+ * @param config
+ * @return
+ * @throws ReferencedObjectUndeletableException
+ * @see eu.etaxonomy.cdm.api.service.INameService#delete(eu.etaxonomy.cdm.model.name.TaxonNameBase, eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator)
+ */
+ @Override
+ public UUID delete(TaxonNameBase name, NameDeletionConfigurator config) throws ReferencedObjectUndeletableException {
+ return defaultNameService.delete(name, config);
+ }
+
+ /**
+ * @param clazz
+ * @param from
+ * @param to
+ * @param criteria
+ * @param pageSize
+ * @param pageValue
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<TaxonNameBase>> pageAuditEvents(Class<? extends TaxonNameBase> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultNameService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths);
+ }
+
+ /**
+ * @param lsid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID)
+ */
+ @Override
+ public TaxonNameBase find(LSID lsid) {
+ return defaultNameService.find(lsid);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID delete(TaxonNameBase persistentObject) {
+ return defaultNameService.delete(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Object[]> groupMarkers(Class<? extends TaxonNameBase> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultNameService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID)
+ */
+ @Override
+ public boolean exists(UUID uuid) {
+ return defaultNameService.exists(uuid);
+ }
+
+ /**
+ * @param name
+ * @param typeDesignation
+ * @see eu.etaxonomy.cdm.api.service.INameService#deleteTypeDesignation(eu.etaxonomy.cdm.model.name.TaxonNameBase, eu.etaxonomy.cdm.model.name.TypeDesignationBase)
+ */
+ @Override
+ public void deleteTypeDesignation(TaxonNameBase name, TypeDesignationBase typeDesignation) {
+ defaultNameService.deleteTypeDesignation(name, typeDesignation);
+ }
+
+ /**
+ * @param x
+ * @param y
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
+ */
+ @Override
+ public TaxonNameBase replace(TaxonNameBase x, TaxonNameBase y) {
+ return defaultNameService.replace(x, y);
+ }
+
+ /**
+ * @param uuidSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set)
+ */
+ @Override
+ public List<TaxonNameBase> find(Set<UUID> uuidSet) {
+ return defaultNameService.find(uuidSet);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<IdentifiableSource> getSources(TaxonNameBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultNameService.getSources(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param typeDesignationCollection
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#saveTypeDesignationAll(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, TypeDesignationBase> saveTypeDesignationAll(Collection<TypeDesignationBase> typeDesignationCollection) {
+ return null;
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID)
+ */
+ @Override
+ public TaxonNameBase find(UUID uuid) {
+ return defaultNameService.find(uuid);
+ }
+
+ /**
+ * @param referencedEntityCollection
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#saveReferencedEntitiesAll(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, ReferencedEntityBase> saveReferencedEntitiesAll(Collection<ReferencedEntityBase> referencedEntityCollection) {
+ return null;
+ }
+
+ /**
+ * @param homotypicalGroups
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#saveAllHomotypicalGroups(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, HomotypicalGroup> saveAllHomotypicalGroups(Collection<HomotypicalGroup> homotypicalGroups) {
+ return null;
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(int)
+ */
+ @Override
+ public TaxonNameBase find(int id) {
+ return defaultNameService.find(id);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<Rights> getRights(TaxonNameBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultNameService.getRights(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean)
+ */
+ @Override
+ public int countMarkers(Class<? extends TaxonNameBase> clazz, Boolean technical) {
+ return defaultNameService.countMarkers(clazz, technical);
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#getAllNomenclaturalStatus(int, int)
+ */
+ @Override
+ public List<NomenclaturalStatus> getAllNomenclaturalStatus(int limit, int start) {
+ return defaultNameService.getAllNomenclaturalStatus(limit, start);
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#getAllTypeDesignations(int, int)
+ */
+ @Override
+ public List<TypeDesignationBase> getAllTypeDesignations(int limit, int start) {
+ return defaultNameService.getAllTypeDesignations(limit, start);
+ }
+
+ /**
+ * @param idSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set)
+ */
+ @Override
+ public List<TaxonNameBase> findById(Set<Integer> idSet) {
+ return defaultNameService.findById(idSet);
+ }
+
+ /**
+ * @param name
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#getNamesByName(java.lang.String)
+ */
+ @Override
+ public List<TaxonNameBase> getNamesByName(String name) {
+ return defaultNameService.getNamesByName(name);
+ }
+
+ /**
+ * @param nameCache
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#getNamesByNameCache(java.lang.String)
+ */
+ @Override
+ public List<NonViralName> getNamesByNameCache(String nameCache) {
+ return defaultNameService.getNamesByNameCache(nameCache);
+ }
+
+ /**
+ * @param clazz
+ * @param idInSource
+ * @param idNamespace
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String)
+ */
+ @Override
+ public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
+ return defaultNameService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#getSession()
+ */
+ @Override
+ public Session getSession() {
+ return defaultNameService.getSession();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<TaxonNameBase>> getUuidAndTitleCache() {
+ return defaultNameService.getUuidAndTitleCache();
+ }
+
+ /**
+ * @param clazz
+ * @param limit
+ * @param start
+ * @param groups
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Object[]> group(Class<? extends TaxonNameBase> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) {
+ return defaultNameService.group(clazz, limit, start, groups, propertyPaths);
+ }
+
+ /**
+ * @param titleCache
+ * @param matchMode
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#findNamesByTitleCache(java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
+ */
+ @Override
+ public List<NonViralName> findNamesByTitleCache(String titleCache, MatchMode matchMode, List<String> propertyPaths) {
+ return defaultNameService.findNamesByTitleCache(titleCache, matchMode, propertyPaths);
+ }
+
+ /**
+ * @param nameCache
+ * @param matchMode
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#findNamesByNameCache(java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
+ */
+ @Override
+ public List<NonViralName> findNamesByNameCache(String nameCache, MatchMode matchMode, List<String> propertyPaths) {
+ return defaultNameService.findNamesByNameCache(nameCache, matchMode, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonNameBase> findByTitle(Class<? extends TaxonNameBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#findNameByUuid(java.util.UUID, java.util.List)
+ */
+ @Override
+ public NonViralName findNameByUuid(UUID uuid, List<String> propertyPaths) {
+ return defaultNameService.findNameByUuid(uuid, propertyPaths);
+ }
+
+ /**
+ * @param name
+ * @param sessionObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#getNamesByName(java.lang.String, eu.etaxonomy.cdm.model.common.CdmBase)
+ */
+ @Override
+ public List getNamesByName(String name, CdmBase sessionObject) {
+ return defaultNameService.getNamesByName(name, sessionObject);
+ }
+
+ /**
+ * @param name
+ * @param accuracy
+ * @param languages
+ * @param highlightFragments
+ * @param propertyPaths
+ * @param maxNoOfResults
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @see eu.etaxonomy.cdm.api.service.INameService#findByNameFuzzySearch(java.lang.String, float, java.util.List, boolean, java.util.List, int)
+ */
+ @Override
+ public List<SearchResult<TaxonNameBase>> findByNameFuzzySearch(String name, float accuracy, List<Language> languages, boolean highlightFragments, List<String> propertyPaths, int maxNoOfResults) throws CorruptIndexException, IOException, ParseException {
+ return defaultNameService.findByNameFuzzySearch(name, accuracy, languages, highlightFragments, propertyPaths, maxNoOfResults);
+ }
+
+ /**
+ * @param type
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonNameBase> list(Class<? extends TaxonNameBase> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.list(type, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Pager<TaxonNameBase> findByTitle(IIdentifiableEntityServiceConfigurator<TaxonNameBase> configurator) {
+ return defaultNameService.findByTitle(configurator);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
+ */
+ @Override
+ public Integer countByTitle(Class<? extends TaxonNameBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) {
+ return defaultNameService.countByTitle(clazz, queryString, matchmode, criteria);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID)
+ */
+ @Override
+ public TaxonNameBase load(UUID uuid) {
+ return defaultNameService.load(uuid);
+ }
+
+ /**
+ * @param name
+ * @param accuracy
+ * @param languages
+ * @param highlightFragments
+ * @param maxNoOfResults
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @see eu.etaxonomy.cdm.api.service.INameService#findByNameFuzzySearch(java.lang.String, float, java.util.List, boolean, int)
+ */
+ @Override
+ public List<DocumentSearchResult> findByNameFuzzySearch(String name, float accuracy, List<Language> languages, boolean highlightFragments, int maxNoOfResults) throws CorruptIndexException, IOException, ParseException {
+ return defaultNameService.findByNameFuzzySearch(name, accuracy, languages, highlightFragments, maxNoOfResults);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List)
+ */
+ @Override
+ public TaxonNameBase load(UUID uuid, List<String> propertyPaths) {
+ return defaultNameService.load(uuid, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Integer countByTitle(IIdentifiableEntityServiceConfigurator<TaxonNameBase> configurator) {
+ return defaultNameService.countByTitle(configurator);
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public TaxonNameBase merge(TaxonNameBase transientObject) {
+ return defaultNameService.merge(transientObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonNameBase> listByTitle(Class<? extends TaxonNameBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonNameBase> page(Class<? extends TaxonNameBase> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.page(type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param name
+ * @param accuracy
+ * @param languages
+ * @param highlightFragments
+ * @param maxNoOfResults
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @see eu.etaxonomy.cdm.api.service.INameService#findByFuzzyNameCacheSearch(java.lang.String, float, java.util.List, boolean, int)
+ */
+ @Override
+ public List<DocumentSearchResult> findByFuzzyNameCacheSearch(String name, float accuracy, List<Language> languages, boolean highlightFragments, int maxNoOfResults) throws CorruptIndexException, IOException, ParseException {
+ return defaultNameService.findByFuzzyNameCacheSearch(name, accuracy, languages, highlightFragments, maxNoOfResults);
+ }
+
+ /**
+ * @param name
+ * @param wildcard
+ * @param languages
+ * @param highlightFragments
+ * @param maxNoOfResults
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @see eu.etaxonomy.cdm.api.service.INameService#findByNameExactSearch(java.lang.String, boolean, java.util.List, boolean, int)
+ */
+ @Override
+ public List<DocumentSearchResult> findByNameExactSearch(String name, boolean wildcard, List<Language> languages, boolean highlightFragments, int maxNoOfResults) throws CorruptIndexException, IOException, ParseException {
+ return defaultNameService.findByNameExactSearch(name, wildcard, languages, highlightFragments, maxNoOfResults);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID refresh(TaxonNameBase persistentObject) {
+ return defaultNameService.refresh(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonNameBase> listByReferenceTitle(Class<? extends TaxonNameBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param tableName
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int)
+ */
+ @Override
+ public List<TaxonNameBase> rows(String tableName, int limit, int start) {
+ return defaultNameService.rows(tableName, limit, start);
+ }
+
+ /**
+ * @param newInstances
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, TaxonNameBase> save(Collection<TaxonNameBase> newInstances) {
+ return null;
+ }
+
+ /**
+ * @param newInstance
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID save(TaxonNameBase newInstance) {
+ return null;
+ }
+
+ /**
+ * @param title
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#findNamesByTitle(java.lang.String)
+ */
+ @Override
+ public List findNamesByTitle(String title) {
+ return defaultNameService.findNamesByTitle(title);
+ }
+
+ /**
+ * @param title
+ * @param sessionObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#findNamesByTitle(java.lang.String, eu.etaxonomy.cdm.model.common.CdmBase)
+ */
+ @Override
+ public List findNamesByTitle(String title, CdmBase sessionObject) {
+ return defaultNameService.findNamesByTitle(title, sessionObject);
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID saveOrUpdate(TaxonNameBase transientObject) {
+ return null;
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#getAllHomotypicalGroups(int, int)
+ */
+ @Override
+ public List<HomotypicalGroup> getAllHomotypicalGroups(int limit, int start) {
+ return defaultNameService.getAllHomotypicalGroups(limit, start);
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.INameService#getAllRelationships(int, int)
+ */
+ @Deprecated
+ @Override
+ public List<RelationshipBase> getAllRelationships(int limit, int start) {
+ return defaultNameService.getAllRelationships(limit, start);
+ }
+
+ /**
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.INameService#getRankVocabulary()
+ */
+ @Deprecated
+ @Override
+ public OrderedTermVocabulary<Rank> getRankVocabulary() {
+ return defaultNameService.getRankVocabulary();
+ }
+
+ /**
+ * @param transientObjects
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, TaxonNameBase> saveOrUpdate(Collection<TaxonNameBase> transientObjects) {
+ return null;
+ }
+
+ /**
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.INameService#getStatusTypeVocabulary()
+ */
+ @Deprecated
+ @Override
+ public TermVocabulary<NomenclaturalStatusType> getStatusTypeVocabulary() {
+ return defaultNameService.getStatusTypeVocabulary();
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID update(TaxonNameBase transientObject) {
+ return defaultNameService.update(transientObject);
+ }
+
+ /**
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.INameService#getSpecimenTypeDesignationStatusVocabulary()
+ */
+ @Deprecated
+ @Override
+ public TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary() {
+ return defaultNameService.getSpecimenTypeDesignationStatusVocabulary();
+ }
+
+ /**
+ * @param example
+ * @param includeProperties
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonNameBase> list(TaxonNameBase example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.INameService#getSpecimenTypeDesignationVocabulary()
+ */
+ @Deprecated
+ @Override
+ public OrderedTermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationVocabulary() {
+ return defaultNameService.getSpecimenTypeDesignationVocabulary();
+ }
+
+ /**
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.INameService#getNameRelationshipTypeVocabulary()
+ */
+ @Deprecated
+ @Override
+ public TermVocabulary<NameRelationshipType> getNameRelationshipTypeVocabulary() {
+ return defaultNameService.getNameRelationshipTypeVocabulary();
+ }
+
+ /**
+ * @param clazz
+ * @param matchStrategy
+ * @param mergeStrategy
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy)
+ */
+ @Override
+ public int deduplicate(Class<? extends TaxonNameBase> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) {
+ return defaultNameService.deduplicate(clazz, matchStrategy, mergeStrategy);
+ }
+
+ /**
+ * @param name
+ * @param direction
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#listNameRelationships(eu.etaxonomy.cdm.model.name.TaxonNameBase, eu.etaxonomy.cdm.model.common.RelationshipBase.Direction, eu.etaxonomy.cdm.model.name.NameRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<NameRelationship> listNameRelationships(TaxonNameBase name, Direction direction, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.listNameRelationships(name, direction, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param matchMode
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode)
+ */
+ @Override
+ public Pager<TaxonNameBase> findTitleCache(Class<? extends TaxonNameBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) {
+ return defaultNameService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode);
+ }
+
+ /**
+ * @param name
+ * @param direction
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#pageNameRelationships(eu.etaxonomy.cdm.model.name.TaxonNameBase, eu.etaxonomy.cdm.model.common.RelationshipBase.Direction, eu.etaxonomy.cdm.model.name.NameRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<NameRelationship> pageNameRelationships(TaxonNameBase name, Direction direction, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.pageNameRelationships(name, direction, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param name
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.INameService#listFromNameRelationships(eu.etaxonomy.cdm.model.name.TaxonNameBase, eu.etaxonomy.cdm.model.name.NameRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public List<NameRelationship> listFromNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.listFromNameRelationships(name, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param name
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.INameService#pageFromNameRelationships(eu.etaxonomy.cdm.model.name.TaxonNameBase, eu.etaxonomy.cdm.model.name.NameRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public Pager<NameRelationship> pageFromNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.pageFromNameRelationships(name, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param name
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.INameService#listToNameRelationships(eu.etaxonomy.cdm.model.name.TaxonNameBase, eu.etaxonomy.cdm.model.name.NameRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public List<NameRelationship> listToNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.listToNameRelationships(name, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param name
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.INameService#pageToNameRelationships(eu.etaxonomy.cdm.model.name.TaxonNameBase, eu.etaxonomy.cdm.model.name.NameRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public Pager<NameRelationship> pageToNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.pageToNameRelationships(name, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param name
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#getHybridNames(eu.etaxonomy.cdm.model.name.NonViralName, eu.etaxonomy.cdm.model.name.HybridRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<HybridRelationship> getHybridNames(NonViralName name, HybridRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.getHybridNames(name, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param name
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#getTypeDesignations(eu.etaxonomy.cdm.model.name.TaxonNameBase, eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name, SpecimenTypeDesignationStatus status, Integer pageSize, Integer pageNumber) {
+ return defaultNameService.getTypeDesignations(name, status, pageSize, pageNumber);
+ }
+
+ /**
+ * @param name
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#getTypeDesignations(eu.etaxonomy.cdm.model.name.TaxonNameBase, eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name, SpecimenTypeDesignationStatus status, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultNameService.getTypeDesignations(name, status, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uninomial
+ * @param infraGenericEpithet
+ * @param specificEpithet
+ * @param infraspecificEpithet
+ * @param rank
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#searchNames(java.lang.String, java.lang.String, java.lang.String, java.lang.String, eu.etaxonomy.cdm.model.name.Rank, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonNameBase> searchNames(String uninomial, String infraGenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.searchNames(uninomial, infraGenericEpithet, specificEpithet, infraspecificEpithet, rank, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonNameBase> search(Class<? extends TaxonNameBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.search(clazz, queryString, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#getUuidAndTitleCacheOfNames()
+ */
+ @Override
+ public List<UuidAndTitleCache> getUuidAndTitleCacheOfNames() {
+ return defaultNameService.getUuidAndTitleCacheOfNames();
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#findByName(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonNameBase> findByName(Class<? extends TaxonNameBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultNameService.findByName(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#findHomotypicalGroup(java.util.UUID)
+ */
+ @Override
+ public HomotypicalGroup findHomotypicalGroup(UUID uuid) {
+ return defaultNameService.findHomotypicalGroup(uuid);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.INameService#getTaggedName(java.util.UUID)
+ */
+ @Override
+ public List<TaggedText> getTaggedName(UUID uuid) {
+ return defaultNameService.getTaggedName(uuid);
+ }
+
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.transientServices;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.lucene.index.CorruptIndexException;
+import org.apache.lucene.queryParser.ParseException;
+import org.hibernate.LockMode;
+import org.hibernate.Session;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.envers.query.criteria.AuditCriterion;
+import org.hibernate.search.spatial.impl.Rectangle;
+
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.api.service.search.SearchResult;
+import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.ISourceable;
+import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.common.LSID;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.cdm.model.location.Country;
+import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.model.view.AuditEvent;
+import eu.etaxonomy.cdm.model.view.AuditEventRecord;
+import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.query.Grouping;
+import eu.etaxonomy.cdm.persistence.query.MatchMode;
+import eu.etaxonomy.cdm.persistence.query.OrderHint;
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+
+/**
+ * @author pplitzner
+ * @date 26.09.2013
+ *
+ */
+public class TransientOccurenceService implements IOccurrenceService {
+
+ private IOccurrenceService defaultService;
+ private List<SpecimenOrObservationBase> units;
+
+ /**
+ * @param defaultService
+ */
+ public TransientOccurenceService(IOccurrenceService defaultService) {
+ this.defaultService = defaultService;
+ this.units = new ArrayList<SpecimenOrObservationBase>();
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<SpecimenOrObservationBase>> pageAuditEvents(SpecimenOrObservationBase t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
+ }
+
+ /**
+ * @param annotatedObj
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Annotation> getAnnotations(SpecimenOrObservationBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IService#clear()
+ */
+ @Override
+ public void clear() {
+ defaultService.clear();
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
+ */
+ @Override
+ public void lock(SpecimenOrObservationBase t, LockMode lockMode) {
+ defaultService.lock(t, lockMode);
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @param propertyPaths
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
+ */
+ @Override
+ public void refresh(SpecimenOrObservationBase t, LockMode lockMode, List<String> propertyPaths) {
+ defaultService.refresh(t, lockMode, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache()
+ */
+ @Override
+ public void updateTitleCache() {
+ defaultService.updateTitleCache();
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<SpecimenOrObservationBase> getNextAuditEvent(SpecimenOrObservationBase t) {
+ return defaultService.getNextAuditEvent(t);
+ }
+
+ /**
+ * @param annotatableEntity
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Marker> getMarkers(SpecimenOrObservationBase annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param stepSize
+ * @param cacheStrategy
+ * @param monitor
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor)
+ */
+ @Override
+ public void updateTitleCache(Class<? extends SpecimenOrObservationBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<SpecimenOrObservationBase> cacheStrategy, IProgressMonitor monitor) {
+ defaultService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor);
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<SpecimenOrObservationBase> getPreviousAuditEvent(SpecimenOrObservationBase t) {
+ return defaultService.getPreviousAuditEvent(t);
+ }
+
+ /**
+ * @param iso639
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getCountryByIso(java.lang.String)
+ */
+ @Override
+ public Country getCountryByIso(String iso639) {
+ return defaultService.getCountryByIso(iso639);
+ }
+
+ /**
+ * @param clazz
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class)
+ */
+ @Override
+ public int count(Class<? extends SpecimenOrObservationBase> clazz) {
+ return defaultService.count(clazz);
+ }
+
+ /**
+ * @param name
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getCountryByName(java.lang.String)
+ */
+ @Override
+ public List<Country> getCountryByName(String name) {
+ return defaultService.getCountryByName(name);
+ }
+
+ /**
+ * @param type
+ * @param determinedAs
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#list(java.lang.Class, eu.etaxonomy.cdm.model.taxon.TaxonBase, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SpecimenOrObservationBase> list(Class<? extends SpecimenOrObservationBase> type, TaxonBase determinedAs, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultService.list(type, determinedAs, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param from
+ * @param to
+ * @param criteria
+ * @param pageSize
+ * @param pageValue
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<SpecimenOrObservationBase>> pageAuditEvents(Class<? extends SpecimenOrObservationBase> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths);
+ }
+
+ /**
+ * @param lsid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID)
+ */
+ @Override
+ public SpecimenOrObservationBase find(LSID lsid) {
+ return defaultService.find(lsid);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID delete(SpecimenOrObservationBase persistentObject) {
+ return defaultService.delete(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Object[]> groupMarkers(Class<? extends SpecimenOrObservationBase> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID)
+ */
+ @Override
+ public boolean exists(UUID uuid) {
+ return defaultService.exists(uuid);
+ }
+
+ /**
+ * @param x
+ * @param y
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
+ */
+ @Override
+ public SpecimenOrObservationBase replace(SpecimenOrObservationBase x, SpecimenOrObservationBase y) {
+ return defaultService.replace(x, y);
+ }
+
+ /**
+ * @param uuidSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set)
+ */
+ @Override
+ public List<SpecimenOrObservationBase> find(Set<UUID> uuidSet) {
+ return defaultService.find(uuidSet);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<IdentifiableSource> getSources(SpecimenOrObservationBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultService.getSources(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID)
+ */
+ @Override
+ public SpecimenOrObservationBase find(UUID uuid) {
+ return defaultService.find(uuid);
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(int)
+ */
+ @Override
+ public SpecimenOrObservationBase find(int id) {
+ return defaultService.find(id);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<Rights> getRights(SpecimenOrObservationBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultService.getRights(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean)
+ */
+ @Override
+ public int countMarkers(Class<? extends SpecimenOrObservationBase> clazz, Boolean technical) {
+ return defaultService.countMarkers(clazz, technical);
+ }
+
+ /**
+ * @param occurence
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getMedia(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<Media> getMedia(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultService.getMedia(occurence, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param idSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set)
+ */
+ @Override
+ public List<SpecimenOrObservationBase> findById(Set<Integer> idSet) {
+ return defaultService.findById(idSet);
+ }
+
+ /**
+ * @param clazz
+ * @param idInSource
+ * @param idNamespace
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String)
+ */
+ @Override
+ public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
+ return defaultService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#getSession()
+ */
+ @Override
+ public Session getSession() {
+ return defaultService.getSession();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<SpecimenOrObservationBase>> getUuidAndTitleCache() {
+ return defaultService.getUuidAndTitleCache();
+ }
+
+ /**
+ * @param clazz
+ * @param limit
+ * @param start
+ * @param groups
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Object[]> group(Class<? extends SpecimenOrObservationBase> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) {
+ return defaultService.group(clazz, limit, start, groups, propertyPaths);
+ }
+
+ /**
+ * @param occurence
+ * @param taxonBase
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getDeterminations(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.model.taxon.TaxonBase, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<DeterminationEvent> getDeterminations(SpecimenOrObservationBase occurence, TaxonBase taxonBase, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultService.getDeterminations(occurence, taxonBase, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SpecimenOrObservationBase> findByTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param occurence
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getDerivationEvents(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<DerivationEvent> getDerivationEvents(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultService.getDerivationEvents(occurence, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<SpecimenOrObservationBase> list(Class<? extends SpecimenOrObservationBase> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultService.list(type, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param query
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SpecimenOrObservationBase> search(Class<? extends SpecimenOrObservationBase> clazz, String query, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultService.search(clazz, query, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Pager<SpecimenOrObservationBase> findByTitle(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator) {
+ return defaultService.findByTitle(configurator);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
+ */
+ @Override
+ public Integer countByTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) {
+ return defaultService.countByTitle(clazz, queryString, matchmode, criteria);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID)
+ */
+ @Override
+ public SpecimenOrObservationBase load(UUID uuid) {
+ return defaultService.load(uuid);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List)
+ */
+ @Override
+ public SpecimenOrObservationBase load(UUID uuid, List<String> propertyPaths) {
+ return defaultService.load(uuid, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Integer countByTitle(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator) {
+ return defaultService.countByTitle(configurator);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getFieldUnitUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<FieldUnit>> getFieldUnitUuidAndTitleCache() {
+ return defaultService.getFieldUnitUuidAndTitleCache();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getDerivedUnitUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<DerivedUnit>> getDerivedUnitUuidAndTitleCache() {
+ return defaultService.getDerivedUnitUuidAndTitleCache();
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public SpecimenOrObservationBase merge(SpecimenOrObservationBase transientObject) {
+ return defaultService.merge(transientObject);
+ }
+
+ /**
+ * @param derivedUnit
+ * @param propertyPaths
+ * @return
+ * @throws DerivedUnitFacadeNotSupportedException
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getDerivedUnitFacade(eu.etaxonomy.cdm.model.occurrence.DerivedUnit, java.util.List)
+ */
+ @Override
+ public DerivedUnitFacade getDerivedUnitFacade(DerivedUnit derivedUnit, List<String> propertyPaths) throws DerivedUnitFacadeNotSupportedException {
+ return defaultService.getDerivedUnitFacade(derivedUnit, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<SpecimenOrObservationBase> listByTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param description
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#listDerivedUnitFacades(eu.etaxonomy.cdm.model.description.DescriptionBase, java.util.List)
+ */
+ @Override
+ public List<DerivedUnitFacade> listDerivedUnitFacades(DescriptionBase description, List<String> propertyPaths) {
+ return defaultService.listDerivedUnitFacades(description, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SpecimenOrObservationBase> page(Class<? extends SpecimenOrObservationBase> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultService.page(type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param includeRelationships
+ * @param associatedTaxon
+ * @param maxDepth
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#listByAssociatedTaxon(java.lang.Class, java.util.Set, eu.etaxonomy.cdm.model.taxon.Taxon, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public <T extends SpecimenOrObservationBase> List<T> listByAssociatedTaxon(Class<T> type, Set<TaxonRelationshipEdge> includeRelationships, Taxon associatedTaxon, Integer maxDepth, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultService.listByAssociatedTaxon(type, includeRelationships, associatedTaxon, maxDepth, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID refresh(SpecimenOrObservationBase persistentObject) {
+ return defaultService.refresh(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<SpecimenOrObservationBase> listByReferenceTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param tableName
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int)
+ */
+ @Override
+ public List<SpecimenOrObservationBase> rows(String tableName, int limit, int start) {
+ return defaultService.rows(tableName, limit, start);
+ }
+
+ /**
+ * @param newInstances
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, SpecimenOrObservationBase> save(Collection<SpecimenOrObservationBase> newInstances) {
+ for(SpecimenOrObservationBase unit:newInstances){
+ save(unit);
+ }
+ return null;
+ }
+
+ /**
+ * @param type
+ * @param includeRelationships
+ * @param associatedTaxon
+ * @param maxDepth
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#pageByAssociatedTaxon(java.lang.Class, java.util.Set, eu.etaxonomy.cdm.model.taxon.Taxon, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public <T extends SpecimenOrObservationBase> Pager<T> pageByAssociatedTaxon(Class<T> type, Set<TaxonRelationshipEdge> includeRelationships, Taxon associatedTaxon, Integer maxDepth, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultService.pageByAssociatedTaxon(type, includeRelationships, associatedTaxon, maxDepth, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param newInstance
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID save(SpecimenOrObservationBase newInstance) {
+ units.add(newInstance);
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID saveOrUpdate(SpecimenOrObservationBase transientObject) {
+ units.add(transientObject);
+ return null;
+ }
+
+ /**
+ * @param transientObjects
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, SpecimenOrObservationBase> saveOrUpdate(Collection<SpecimenOrObservationBase> transientObjects) {
+ for(SpecimenOrObservationBase unit:transientObjects){
+ saveOrUpdate(unit);
+ }
+ return null;
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param boundingBox
+ * @param languages
+ * @param highlightFragments
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#findByFullText(java.lang.Class, java.lang.String, org.hibernate.search.spatial.impl.Rectangle, java.util.List, boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SearchResult<SpecimenOrObservationBase>> findByFullText(Class<? extends SpecimenOrObservationBase> clazz, String queryString, Rectangle boundingBox, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException {
+ return defaultService.findByFullText(clazz, queryString, boundingBox, languages, highlightFragments, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID update(SpecimenOrObservationBase transientObject) {
+ return defaultService.update(transientObject);
+ }
+
+ /**
+ * @param example
+ * @param includeProperties
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<SpecimenOrObservationBase> list(SpecimenOrObservationBase example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param matchStrategy
+ * @param mergeStrategy
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy)
+ */
+ @Override
+ public int deduplicate(Class<? extends SpecimenOrObservationBase> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) {
+ return defaultService.deduplicate(clazz, matchStrategy, mergeStrategy);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param matchMode
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode)
+ */
+ @Override
+ public Pager<SpecimenOrObservationBase> findTitleCache(Class<? extends SpecimenOrObservationBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) {
+ return defaultService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode);
+ }
+
+ /**
+ * @return
+ */
+ public List<SpecimenOrObservationBase> getUnits() {
+ return units;
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.transientServices;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.hibernate.LockMode;
+import org.hibernate.Session;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.envers.query.criteria.AuditCriterion;
+
+import eu.etaxonomy.cdm.api.service.IReferenceService;
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.ISourceable;
+import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.common.LSID;
+import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
+import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.model.view.AuditEvent;
+import eu.etaxonomy.cdm.model.view.AuditEventRecord;
+import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.query.Grouping;
+import eu.etaxonomy.cdm.persistence.query.MatchMode;
+import eu.etaxonomy.cdm.persistence.query.OrderHint;
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+
+/**
+ * @author pplitzner
+ * @date 27.09.2013
+ *
+ */
+public class TransientReferenceService implements IReferenceService {
+
+ private IReferenceService defaultReferenceService;
+
+ /**
+ * @param defaultReferenceService
+ */
+ public TransientReferenceService(IReferenceService defaultReferenceService) {
+ this.defaultReferenceService = defaultReferenceService;
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IReferenceService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Reference> search(Class<? extends Reference> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultReferenceService.search(clazz, queryString, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<Reference>> pageAuditEvents(Reference t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultReferenceService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
+ }
+
+ /**
+ * @param annotatedObj
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Annotation> getAnnotations(Reference annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultReferenceService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IService#clear()
+ */
+ @Override
+ public void clear() {
+ defaultReferenceService.clear();
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
+ */
+ @Override
+ public void lock(Reference t, LockMode lockMode) {
+ defaultReferenceService.lock(t, lockMode);
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @param propertyPaths
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
+ */
+ @Override
+ public void refresh(Reference t, LockMode lockMode, List<String> propertyPaths) {
+ defaultReferenceService.refresh(t, lockMode, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache()
+ */
+ @Override
+ public void updateTitleCache() {
+ defaultReferenceService.updateTitleCache();
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<Reference> getNextAuditEvent(Reference t) {
+ return defaultReferenceService.getNextAuditEvent(t);
+ }
+
+ /**
+ * @param annotatableEntity
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Marker> getMarkers(Reference annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultReferenceService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IReferenceService#getUuidAndTitle()
+ */
+ @Override
+ public List<UuidAndTitleCache<Reference>> getUuidAndTitle() {
+ return defaultReferenceService.getUuidAndTitle();
+ }
+
+ /**
+ * @param clazz
+ * @param stepSize
+ * @param cacheStrategy
+ * @param monitor
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor)
+ */
+ @Override
+ public void updateTitleCache(Class<? extends Reference> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<Reference> cacheStrategy, IProgressMonitor monitor) {
+ defaultReferenceService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor);
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<Reference> getPreviousAuditEvent(Reference t) {
+ return defaultReferenceService.getPreviousAuditEvent(t);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IReferenceService#getAllReferencesForPublishing()
+ */
+ @Override
+ public List<Reference> getAllReferencesForPublishing() {
+ return defaultReferenceService.getAllReferencesForPublishing();
+ }
+
+ /**
+ * @param clazz
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class)
+ */
+ @Override
+ public int count(Class<? extends Reference> clazz) {
+ return defaultReferenceService.count(clazz);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IReferenceService#getAllNomenclaturalReferences()
+ */
+ @Override
+ public List<Reference> getAllNomenclaturalReferences() {
+ return defaultReferenceService.getAllNomenclaturalReferences();
+ }
+
+ /**
+ * @param reference
+ * @param includeSubordinateReferences
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IReferenceService#listCoveredTaxa(eu.etaxonomy.cdm.model.reference.Reference, boolean, java.util.List)
+ */
+ @Override
+ public List<TaxonBase> listCoveredTaxa(Reference reference, boolean includeSubordinateReferences, List<String> propertyPaths) {
+ return defaultReferenceService.listCoveredTaxa(reference, includeSubordinateReferences, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param from
+ * @param to
+ * @param criteria
+ * @param pageSize
+ * @param pageValue
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<Reference>> pageAuditEvents(Class<? extends Reference> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultReferenceService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths);
+ }
+
+ /**
+ * @param lsid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID)
+ */
+ @Override
+ public Reference find(LSID lsid) {
+ return defaultReferenceService.find(lsid);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID delete(Reference persistentObject) {
+ return defaultReferenceService.delete(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Object[]> groupMarkers(Class<? extends Reference> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultReferenceService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID)
+ */
+ @Override
+ public boolean exists(UUID uuid) {
+ return defaultReferenceService.exists(uuid);
+ }
+
+ /**
+ * @param x
+ * @param y
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
+ */
+ @Override
+ public Reference replace(Reference x, Reference y) {
+ return defaultReferenceService.replace(x, y);
+ }
+
+ /**
+ * @param uuidSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set)
+ */
+ @Override
+ public List<Reference> find(Set<UUID> uuidSet) {
+ return defaultReferenceService.find(uuidSet);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<IdentifiableSource> getSources(Reference t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultReferenceService.getSources(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID)
+ */
+ @Override
+ public Reference find(UUID uuid) {
+ return defaultReferenceService.find(uuid);
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(int)
+ */
+ @Override
+ public Reference find(int id) {
+ return defaultReferenceService.find(id);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<Rights> getRights(Reference t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultReferenceService.getRights(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean)
+ */
+ @Override
+ public int countMarkers(Class<? extends Reference> clazz, Boolean technical) {
+ return defaultReferenceService.countMarkers(clazz, technical);
+ }
+
+ /**
+ * @param idSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set)
+ */
+ @Override
+ public List<Reference> findById(Set<Integer> idSet) {
+ return defaultReferenceService.findById(idSet);
+ }
+
+ /**
+ * @param clazz
+ * @param idInSource
+ * @param idNamespace
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String)
+ */
+ @Override
+ public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
+ return defaultReferenceService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#getSession()
+ */
+ @Override
+ public Session getSession() {
+ return defaultReferenceService.getSession();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<Reference>> getUuidAndTitleCache() {
+ return defaultReferenceService.getUuidAndTitleCache();
+ }
+
+ /**
+ * @param clazz
+ * @param limit
+ * @param start
+ * @param groups
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Object[]> group(Class<? extends Reference> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) {
+ return defaultReferenceService.group(clazz, limit, start, groups, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Reference> findByTitle(Class<? extends Reference> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultReferenceService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Reference> list(Class<? extends Reference> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultReferenceService.list(type, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Pager<Reference> findByTitle(IIdentifiableEntityServiceConfigurator<Reference> configurator) {
+ return defaultReferenceService.findByTitle(configurator);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
+ */
+ @Override
+ public Integer countByTitle(Class<? extends Reference> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) {
+ return defaultReferenceService.countByTitle(clazz, queryString, matchmode, criteria);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID)
+ */
+ @Override
+ public Reference load(UUID uuid) {
+ return defaultReferenceService.load(uuid);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List)
+ */
+ @Override
+ public Reference load(UUID uuid, List<String> propertyPaths) {
+ return defaultReferenceService.load(uuid, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Integer countByTitle(IIdentifiableEntityServiceConfigurator<Reference> configurator) {
+ return defaultReferenceService.countByTitle(configurator);
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public Reference merge(Reference transientObject) {
+ return defaultReferenceService.merge(transientObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Reference> listByTitle(Class<? extends Reference> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultReferenceService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Reference> page(Class<? extends Reference> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultReferenceService.page(type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID refresh(Reference persistentObject) {
+ return defaultReferenceService.refresh(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Reference> listByReferenceTitle(Class<? extends Reference> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultReferenceService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param tableName
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int)
+ */
+ @Override
+ public List<Reference> rows(String tableName, int limit, int start) {
+ return defaultReferenceService.rows(tableName, limit, start);
+ }
+
+ /**
+ * @param newInstances
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, Reference> save(Collection<Reference> newInstances) {
+ return null;
+ }
+
+ /**
+ * @param newInstance
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID save(Reference newInstance) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID saveOrUpdate(Reference transientObject) {
+ return null;
+ }
+
+ /**
+ * @param transientObjects
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, Reference> saveOrUpdate(Collection<Reference> transientObjects) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID update(Reference transientObject) {
+ return defaultReferenceService.update(transientObject);
+ }
+
+ /**
+ * @param example
+ * @param includeProperties
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Reference> list(Reference example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultReferenceService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param matchStrategy
+ * @param mergeStrategy
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy)
+ */
+ @Override
+ public int deduplicate(Class<? extends Reference> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) {
+ return defaultReferenceService.deduplicate(clazz, matchStrategy, mergeStrategy);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param matchMode
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode)
+ */
+ @Override
+ public Pager<Reference> findTitleCache(Class<? extends Reference> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) {
+ return defaultReferenceService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode);
+ }
+
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.transientServices;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.lucene.index.CorruptIndexException;
+import org.apache.lucene.queryParser.ParseException;
+import org.hibernate.LockMode;
+import org.hibernate.Session;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.envers.query.criteria.AuditCriterion;
+
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.TaxaAndNamesSearchMode;
+import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.config.MatchingTaxonConfigurator;
+import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;
+import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;
+import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.api.service.search.LuceneMultiSearchException;
+import eu.etaxonomy.cdm.api.service.search.SearchResult;
+import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.ISourceable;
+import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.common.LSID;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;
+import eu.etaxonomy.cdm.model.common.RelationshipBase;
+import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction;
+import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.cdm.model.media.MediaRepresentation;
+import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
+import eu.etaxonomy.cdm.model.name.Rank;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
+import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+import eu.etaxonomy.cdm.model.view.AuditEvent;
+import eu.etaxonomy.cdm.model.view.AuditEventRecord;
+import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.fetch.CdmFetch;
+import eu.etaxonomy.cdm.persistence.query.Grouping;
+import eu.etaxonomy.cdm.persistence.query.MatchMode;
+import eu.etaxonomy.cdm.persistence.query.OrderHint;
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+
+/**
+ * @author pplitzner
+ * @date 27.09.2013
+ *
+ */
+public class TransientTaxonService implements ITaxonService {
+
+ private final ITaxonService defaultTaxonService;
+
+ /**
+ * @param defaultTaxonService
+ */
+ public TransientTaxonService(ITaxonService defaultTaxonService) {
+ this.defaultTaxonService = defaultTaxonService;
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<TaxonBase>> pageAuditEvents(TaxonBase t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultTaxonService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
+ }
+
+ /**
+ * @param annotatedObj
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Annotation> getAnnotations(TaxonBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IService#clear()
+ */
+ @Override
+ public void clear() {
+ defaultTaxonService.clear();
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
+ */
+ @Override
+ public void lock(TaxonBase t, LockMode lockMode) {
+ defaultTaxonService.lock(t, lockMode);
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @param propertyPaths
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
+ */
+ @Override
+ public void refresh(TaxonBase t, LockMode lockMode, List<String> propertyPaths) {
+ defaultTaxonService.refresh(t, lockMode, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache()
+ */
+ @Override
+ public void updateTitleCache() {
+ defaultTaxonService.updateTitleCache();
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<TaxonBase> getNextAuditEvent(TaxonBase t) {
+ return defaultTaxonService.getNextAuditEvent(t);
+ }
+
+ /**
+ * @param annotatableEntity
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Marker> getMarkers(TaxonBase annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param stepSize
+ * @param cacheStrategy
+ * @param monitor
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor)
+ */
+ @Override
+ public void updateTitleCache(Class<? extends TaxonBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<TaxonBase> cacheStrategy, IProgressMonitor monitor) {
+ defaultTaxonService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor);
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<TaxonBase> getPreviousAuditEvent(TaxonBase t) {
+ return defaultTaxonService.getPreviousAuditEvent(t);
+ }
+
+ /**
+ * @param clazz
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class)
+ */
+ @Override
+ public int count(Class<? extends TaxonBase> clazz) {
+ return defaultTaxonService.count(clazz);
+ }
+
+ /**
+ * @param clazz
+ * @param from
+ * @param to
+ * @param criteria
+ * @param pageSize
+ * @param pageValue
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<TaxonBase>> pageAuditEvents(Class<? extends TaxonBase> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultTaxonService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths);
+ }
+
+ /**
+ * @param lsid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID)
+ */
+ @Override
+ public TaxonBase find(LSID lsid) {
+ return defaultTaxonService.find(lsid);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID delete(TaxonBase persistentObject) {
+ return defaultTaxonService.delete(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Object[]> groupMarkers(Class<? extends TaxonBase> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultTaxonService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID)
+ */
+ @Override
+ public boolean exists(UUID uuid) {
+ return defaultTaxonService.exists(uuid);
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getAllSynonyms(int, int)
+ */
+ @Override
+ public List<Synonym> getAllSynonyms(int limit, int start) {
+ return defaultTaxonService.getAllSynonyms(limit, start);
+ }
+
+ /**
+ * @param x
+ * @param y
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
+ */
+ @Override
+ public TaxonBase replace(TaxonBase x, TaxonBase y) {
+ return defaultTaxonService.replace(x, y);
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getAllTaxa(int, int)
+ */
+ @Override
+ public List<Taxon> getAllTaxa(int limit, int start) {
+ return defaultTaxonService.getAllTaxa(limit, start);
+ }
+
+ /**
+ * @param uuidSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set)
+ */
+ @Override
+ public List<TaxonBase> find(Set<UUID> uuidSet) {
+ return defaultTaxonService.find(uuidSet);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<IdentifiableSource> getSources(TaxonBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultTaxonService.getSources(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param sec
+ * @param cdmFetch
+ * @param onlyWithChildren
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getRootTaxa(eu.etaxonomy.cdm.model.reference.Reference, eu.etaxonomy.cdm.persistence.fetch.CdmFetch, boolean)
+ */
+ @Deprecated
+ @Override
+ public List<Taxon> getRootTaxa(Reference sec, CdmFetch cdmFetch, boolean onlyWithChildren) {
+ return defaultTaxonService.getRootTaxa(sec, cdmFetch, onlyWithChildren);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID)
+ */
+ @Override
+ public TaxonBase find(UUID uuid) {
+ return defaultTaxonService.find(uuid);
+ }
+
+ /**
+ * @param rank
+ * @param sec
+ * @param onlyWithChildren
+ * @param withMisapplications
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getRootTaxa(eu.etaxonomy.cdm.model.name.Rank, eu.etaxonomy.cdm.model.reference.Reference, boolean, boolean, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public List<Taxon> getRootTaxa(Rank rank, Reference sec, boolean onlyWithChildren, boolean withMisapplications, List<String> propertyPaths) {
+ return defaultTaxonService.getRootTaxa(rank, sec, onlyWithChildren, withMisapplications, propertyPaths);
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(int)
+ */
+ @Override
+ public TaxonBase find(int id) {
+ return defaultTaxonService.find(id);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<Rights> getRights(TaxonBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultTaxonService.getRights(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean)
+ */
+ @Override
+ public int countMarkers(Class<? extends TaxonBase> clazz, Boolean technical) {
+ return defaultTaxonService.countMarkers(clazz, technical);
+ }
+
+ /**
+ * @param idSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set)
+ */
+ @Override
+ public List<TaxonBase> findById(Set<Integer> idSet) {
+ return defaultTaxonService.findById(idSet);
+ }
+
+ /**
+ * @param clazz
+ * @param idInSource
+ * @param idNamespace
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String)
+ */
+ @Override
+ public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
+ return defaultTaxonService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#getSession()
+ */
+ @Override
+ public Session getSession() {
+ return defaultTaxonService.getSession();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCache() {
+ return defaultTaxonService.getUuidAndTitleCache();
+ }
+
+ /**
+ * @param clazz
+ * @param limit
+ * @param start
+ * @param groups
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Object[]> group(Class<? extends TaxonBase> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) {
+ return defaultTaxonService.group(clazz, limit, start, groups, propertyPaths);
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getAllRelationships(int, int)
+ */
+ @Override
+ public List<RelationshipBase> getAllRelationships(int limit, int start) {
+ return defaultTaxonService.getAllRelationships(limit, start);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonBase> findByTitle(Class<? extends TaxonBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getTaxonRelationshipTypeVocabulary()
+ */
+ @Deprecated
+ @Override
+ public OrderedTermVocabulary<TaxonRelationshipType> getTaxonRelationshipTypeVocabulary() {
+ return defaultTaxonService.getTaxonRelationshipTypeVocabulary();
+ }
+
+ /**
+ * @param name
+ * @param sec
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#searchTaxaByName(java.lang.String, eu.etaxonomy.cdm.model.reference.Reference)
+ */
+ @Override
+ public List<TaxonBase> searchTaxaByName(String name, Reference sec) {
+ return defaultTaxonService.searchTaxaByName(name, sec);
+ }
+
+ /**
+ * @param synonym
+ * @param acceptedTaxon
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#swapSynonymAndAcceptedTaxon(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon)
+ */
+ @Override
+ public void swapSynonymAndAcceptedTaxon(Synonym synonym, Taxon acceptedTaxon) {
+ defaultTaxonService.swapSynonymAndAcceptedTaxon(synonym, acceptedTaxon);
+ }
+
+ /**
+ * @param type
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonBase> list(Class<? extends TaxonBase> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.list(type, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Pager<TaxonBase> findByTitle(IIdentifiableEntityServiceConfigurator<TaxonBase> configurator) {
+ return defaultTaxonService.findByTitle(configurator);
+ }
+
+ /**
+ * @param synonym
+ * @param acceptedTaxon
+ * @param deleteSynonym
+ * @param copyCitationInfo
+ * @param citation
+ * @param microCitation
+ * @return
+ * @throws HomotypicalGroupChangeException
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#changeSynonymToAcceptedTaxon(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon, boolean, boolean, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String)
+ */
+ @Override
+ public Taxon changeSynonymToAcceptedTaxon(Synonym synonym, Taxon acceptedTaxon, boolean deleteSynonym, boolean copyCitationInfo, Reference citation, String microCitation) throws HomotypicalGroupChangeException {
+ return defaultTaxonService.changeSynonymToAcceptedTaxon(synonym, acceptedTaxon, deleteSynonym, copyCitationInfo, citation, microCitation);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
+ */
+ @Override
+ public Integer countByTitle(Class<? extends TaxonBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) {
+ return defaultTaxonService.countByTitle(clazz, queryString, matchmode, criteria);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID)
+ */
+ @Override
+ public TaxonBase load(UUID uuid) {
+ return defaultTaxonService.load(uuid);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List)
+ */
+ @Override
+ public TaxonBase load(UUID uuid, List<String> propertyPaths) {
+ return defaultTaxonService.load(uuid, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Integer countByTitle(IIdentifiableEntityServiceConfigurator<TaxonBase> configurator) {
+ return defaultTaxonService.countByTitle(configurator);
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public TaxonBase merge(TaxonBase transientObject) {
+ return defaultTaxonService.merge(transientObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonBase> listByTitle(Class<? extends TaxonBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonBase> page(Class<? extends TaxonBase> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.page(type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID refresh(TaxonBase persistentObject) {
+ return defaultTaxonService.refresh(persistentObject);
+ }
+
+ /**
+ * @param synonym
+ * @param toTaxon
+ * @param taxonRelationshipType
+ * @param reference
+ * @param microReference
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#changeSynonymToRelatedTaxon(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String)
+ */
+ @Override
+ public Taxon changeSynonymToRelatedTaxon(Synonym synonym, Taxon toTaxon, TaxonRelationshipType taxonRelationshipType, Reference reference, String microReference) {
+ return defaultTaxonService.changeSynonymToRelatedTaxon(synonym, toTaxon, taxonRelationshipType, reference, microReference);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonBase> listByReferenceTitle(Class<? extends TaxonBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param tableName
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int)
+ */
+ @Override
+ public List<TaxonBase> rows(String tableName, int limit, int start) {
+ return defaultTaxonService.rows(tableName, limit, start);
+ }
+
+ /**
+ * @param newInstances
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, TaxonBase> save(Collection<TaxonBase> newInstances) {
+ return null;
+ }
+
+ /**
+ * @param syn
+ * @param taxon
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonymRelationships(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon)
+ */
+ @Override
+ public long deleteSynonymRelationships(Synonym syn, Taxon taxon) {
+ return defaultTaxonService.deleteSynonymRelationships(syn, taxon);
+ }
+
+ /**
+ * @param newInstance
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID save(TaxonBase newInstance) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID saveOrUpdate(TaxonBase transientObject) {
+ return null;
+ }
+
+ /**
+ * @param synonym
+ * @param newHomotypicalGroup
+ * @param targetTaxon
+ * @param removeFromOtherTaxa
+ * @param setBasionymRelationIfApplicable
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#changeHomotypicalGroupOfSynonym(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.name.HomotypicalGroup, eu.etaxonomy.cdm.model.taxon.Taxon, boolean, boolean)
+ */
+ @Override
+ public void changeHomotypicalGroupOfSynonym(Synonym synonym, HomotypicalGroup newHomotypicalGroup, Taxon targetTaxon, boolean removeFromOtherTaxa, boolean setBasionymRelationIfApplicable) {
+ defaultTaxonService.changeHomotypicalGroupOfSynonym(synonym, newHomotypicalGroup, targetTaxon, removeFromOtherTaxa, setBasionymRelationIfApplicable);
+ }
+
+ /**
+ * @param transientObjects
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, TaxonBase> saveOrUpdate(Collection<TaxonBase> transientObjects) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID update(TaxonBase transientObject) {
+ return defaultTaxonService.update(transientObject);
+ }
+
+ /**
+ * @param example
+ * @param includeProperties
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonBase> list(TaxonBase example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param oldSynonymRelation
+ * @param newTaxon
+ * @param moveHomotypicGroup
+ * @param newSynonymRelationshipType
+ * @param newReference
+ * @param newReferenceDetail
+ * @param keepReference
+ * @return
+ * @throws HomotypicalGroupChangeException
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#moveSynonymToAnotherTaxon(eu.etaxonomy.cdm.model.taxon.SynonymRelationship, eu.etaxonomy.cdm.model.taxon.Taxon, boolean, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String, boolean)
+ */
+ @Override
+ public SynonymRelationship moveSynonymToAnotherTaxon(SynonymRelationship oldSynonymRelation, Taxon newTaxon, boolean moveHomotypicGroup, SynonymRelationshipType newSynonymRelationshipType, Reference newReference, String newReferenceDetail, boolean keepReference) throws HomotypicalGroupChangeException {
+ return defaultTaxonService.moveSynonymToAnotherTaxon(oldSynonymRelation, newTaxon, moveHomotypicGroup, newSynonymRelationshipType, newReference, newReferenceDetail, keepReference);
+ }
+
+ /**
+ * @param clazz
+ * @param matchStrategy
+ * @param mergeStrategy
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy)
+ */
+ @Override
+ public int deduplicate(Class<? extends TaxonBase> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) {
+ return defaultTaxonService.deduplicate(clazz, matchStrategy, mergeStrategy);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param matchMode
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode)
+ */
+ @Override
+ public Pager<TaxonBase> findTitleCache(Class<? extends TaxonBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) {
+ return defaultTaxonService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode);
+ }
+
+ /**
+ * @param taxon
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listToTaxonRelationships(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonRelationship> listToTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.listToTaxonRelationships(taxon, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#pageToTaxonRelationships(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonRelationship> pageToTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.pageToTaxonRelationships(taxon, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listFromTaxonRelationships(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonRelationship> listFromTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.listFromTaxonRelationships(taxon, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#pageFromTaxonRelationships(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonRelationship> pageFromTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.pageFromTaxonRelationships(taxon, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param includeRelationships
+ * @param maxDepth
+ * @param limit
+ * @param start
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listRelatedTaxa(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Set<Taxon> listRelatedTaxa(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships, Integer maxDepth, Integer limit, Integer start, List<String> propertyPaths) {
+ return defaultTaxonService.listRelatedTaxa(taxon, includeRelationships, maxDepth, limit, start, propertyPaths);
+ }
+
+ /**
+ * @param taxonBase
+ * @param limit
+ * @param start
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listClassifications(eu.etaxonomy.cdm.model.taxon.TaxonBase, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Classification> listClassifications(TaxonBase taxonBase, Integer limit, Integer start, List<String> propertyPaths) {
+ return defaultTaxonService.listClassifications(taxonBase, limit, start, propertyPaths);
+ }
+
+ /**
+ * @param synonym
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getSynonyms(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SynonymRelationship> getSynonyms(Synonym synonym, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.getSynonyms(synonym, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getSynonyms(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SynonymRelationship> getSynonyms(Taxon taxon, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.getSynonyms(taxon, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getHomotypicSynonymsByHomotypicGroup(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.List)
+ */
+ @Override
+ public List<Synonym> getHomotypicSynonymsByHomotypicGroup(Taxon taxon, List<String> propertyPaths) {
+ return defaultTaxonService.getHomotypicSynonymsByHomotypicGroup(taxon, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getHeterotypicSynonymyGroups(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.List)
+ */
+ @Override
+ public List<List<Synonym>> getHeterotypicSynonymyGroups(Taxon taxon, List<String> propertyPaths) {
+ return defaultTaxonService.getHeterotypicSynonymyGroups(taxon, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonBase> search(Class<? extends TaxonBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.search(clazz, queryString, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param uninomial
+ * @param infragenericEpithet
+ * @param specificEpithet
+ * @param infraspecificEpithet
+ * @param rank
+ * @param pageSize
+ * @param pageNumber
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxaByName(java.lang.Class, java.lang.String, java.lang.String, java.lang.String, java.lang.String, eu.etaxonomy.cdm.model.name.Rank, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public Pager<TaxonBase> findTaxaByName(Class<? extends TaxonBase> clazz, String uninomial, String infragenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber) {
+ return defaultTaxonService.findTaxaByName(clazz, uninomial, infragenericEpithet, specificEpithet, infraspecificEpithet, rank, pageSize, pageNumber);
+ }
+
+ /**
+ * @param clazz
+ * @param uninomial
+ * @param infragenericEpithet
+ * @param specificEpithet
+ * @param infraspecificEpithet
+ * @param rank
+ * @param pageSize
+ * @param pageNumber
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listTaxaByName(java.lang.Class, java.lang.String, java.lang.String, java.lang.String, java.lang.String, eu.etaxonomy.cdm.model.name.Rank, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public List<TaxonBase> listTaxaByName(Class<? extends TaxonBase> clazz, String uninomial, String infragenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber) {
+ return defaultTaxonService.listTaxaByName(clazz, uninomial, infragenericEpithet, specificEpithet, infraspecificEpithet, rank, pageSize, pageNumber);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxaAndNames(eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator)
+ */
+ @Override
+ public Pager<IdentifiableEntity> findTaxaAndNames(IFindTaxaAndNamesConfigurator configurator) {
+ return defaultTaxonService.findTaxaAndNames(configurator);
+ }
+
+ /**
+ * @param queryString
+ * @param classification
+ * @param languages
+ * @param highlightFragments
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @throws LuceneMultiSearchException
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findByEverythingFullText(java.lang.String, eu.etaxonomy.cdm.model.taxon.Classification, java.util.List, boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public Pager<SearchResult<TaxonBase>> findByEverythingFullText(String queryString, Classification classification, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
+ return defaultTaxonService.findByEverythingFullText(queryString, classification, languages, highlightFragments, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param classification
+ * @param languages
+ * @param highlightFragments
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findByFullText(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.model.taxon.Classification, java.util.List, boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SearchResult<TaxonBase>> findByFullText(Class<? extends TaxonBase> clazz, String queryString, Classification classification, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException {
+ return defaultTaxonService.findByFullText(clazz, queryString, classification, languages, highlightFragments, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param areaFilter
+ * @param statusFilter
+ * @param classification
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @throws IOException
+ * @throws ParseException
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findByDistribution(java.util.List, java.util.List, eu.etaxonomy.cdm.model.taxon.Classification, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SearchResult<TaxonBase>> findByDistribution(List<NamedArea> areaFilter, List<PresenceAbsenceTermBase<?>> statusFilter, Classification classification, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, ParseException {
+ return defaultTaxonService.findByDistribution(areaFilter, statusFilter, classification, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param searchModes
+ * @param queryString
+ * @param classification
+ * @param namedAreas
+ * @param distributionStatus
+ * @param languages
+ * @param highlightFragments
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @throws LuceneMultiSearchException
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxaAndNamesByFullText(java.util.EnumSet, java.lang.String, eu.etaxonomy.cdm.model.taxon.Classification, java.util.Set, java.util.Set, java.util.List, boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SearchResult<TaxonBase>> findTaxaAndNamesByFullText(EnumSet<TaxaAndNamesSearchMode> searchModes, String queryString, Classification classification, Set<NamedArea> namedAreas, Set<PresenceAbsenceTermBase<?>> distributionStatus, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
+ return defaultTaxonService.findTaxaAndNamesByFullText(searchModes, queryString, classification, namedAreas, distributionStatus, languages, highlightFragments, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param classification
+ * @param features
+ * @param languages
+ * @param highlightFragments
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findByDescriptionElementFullText(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.model.taxon.Classification, java.util.List, java.util.List, boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SearchResult<TaxonBase>> findByDescriptionElementFullText(Class<? extends DescriptionElementBase> clazz, String queryString, Classification classification, List<Feature> features, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException {
+ return defaultTaxonService.findByDescriptionElementFullText(clazz, queryString, classification, features, languages, highlightFragments, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param size
+ * @param height
+ * @param widthOrDuration
+ * @param mimeTypes
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getAllMedia(eu.etaxonomy.cdm.model.taxon.Taxon, int, int, int, java.lang.String[])
+ */
+ @Deprecated
+ @Override
+ public List<MediaRepresentation> getAllMedia(Taxon taxon, int size, int height, int widthOrDuration, String[] mimeTypes) {
+ return defaultTaxonService.getAllMedia(taxon, size, height, widthOrDuration, mimeTypes);
+ }
+
+ /**
+ * @param taxon
+ * @param includeRelationships
+ * @param limitToGalleries
+ * @param propertyPath
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listTaxonDescriptionMedia(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, boolean, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public List<Media> listTaxonDescriptionMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships, boolean limitToGalleries, List<String> propertyPath) {
+ return defaultTaxonService.listTaxonDescriptionMedia(taxon, includeRelationships, limitToGalleries, propertyPath);
+ }
+
+ /**
+ * @param taxon
+ * @param includeRelationships
+ * @param limitToGalleries
+ * @param includeTaxonDescriptions
+ * @param includeOccurrences
+ * @param includeTaxonNameDescriptions
+ * @param propertyPath
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listMedia(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean, java.util.List)
+ */
+ @Override
+ public List<Media> listMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships, Boolean limitToGalleries, Boolean includeTaxonDescriptions, Boolean includeOccurrences, Boolean includeTaxonNameDescriptions, List<String> propertyPath) {
+ return defaultTaxonService.listMedia(taxon, includeRelationships, limitToGalleries, includeTaxonDescriptions, includeOccurrences, includeTaxonNameDescriptions, propertyPath);
+ }
+
+ /**
+ * @param listOfIDs
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxaByID(java.util.Set)
+ */
+ @Override
+ public List<TaxonBase> findTaxaByID(Set<Integer> listOfIDs) {
+ return defaultTaxonService.findTaxaByID(listOfIDs);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxonByUuid(java.util.UUID, java.util.List)
+ */
+ @Override
+ public TaxonBase findTaxonByUuid(UUID uuid, List<String> propertyPaths) {
+ return defaultTaxonService.findTaxonByUuid(uuid, propertyPaths);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#countAllRelationships()
+ */
+ @Override
+ public int countAllRelationships() {
+ return defaultTaxonService.countAllRelationships();
+ }
+
+ /**
+ * @param propertyPath
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findIdenticalTaxonNames(java.util.List)
+ */
+ @Override
+ public List<TaxonNameBase> findIdenticalTaxonNames(List<String> propertyPath) {
+ return defaultTaxonService.findIdenticalTaxonNames(propertyPath);
+ }
+
+ /**
+ * @param propertyPath
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findIdenticalTaxonNameIds(java.util.List)
+ */
+ @Override
+ public List<TaxonNameBase> findIdenticalTaxonNameIds(List<String> propertyPath) {
+ return defaultTaxonService.findIdenticalTaxonNameIds(propertyPath);
+ }
+
+ /**
+ * @param name
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getPhylumName(eu.etaxonomy.cdm.model.name.TaxonNameBase)
+ */
+ @Override
+ public String getPhylumName(TaxonNameBase name) {
+ return defaultTaxonService.getPhylumName(name);
+ }
+
+ /**
+ * @param syn
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonymRelationships(eu.etaxonomy.cdm.model.taxon.Synonym)
+ */
+ @Override
+ public long deleteSynonymRelationships(Synonym syn) {
+ return defaultTaxonService.deleteSynonymRelationships(syn);
+ }
+
+ /**
+ * @param taxonBase
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @param direction
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listSynonymRelationships(eu.etaxonomy.cdm.model.taxon.TaxonBase, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List, eu.etaxonomy.cdm.model.common.RelationshipBase.Direction)
+ */
+ @Override
+ public List<SynonymRelationship> listSynonymRelationships(TaxonBase taxonBase, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths, Direction direction) {
+ return defaultTaxonService.listSynonymRelationships(taxonBase, type, pageSize, pageNumber, orderHints, propertyPaths, direction);
+ }
+
+ /**
+ * @param taxonName
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findBestMatchingTaxon(java.lang.String)
+ */
+ @Override
+ public Taxon findBestMatchingTaxon(String taxonName) {
+ return defaultTaxonService.findBestMatchingTaxon(taxonName);
+ }
+
+ /**
+ * @param config
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findBestMatchingTaxon(eu.etaxonomy.cdm.api.service.config.MatchingTaxonConfigurator)
+ */
+ @Override
+ public Taxon findBestMatchingTaxon(MatchingTaxonConfigurator config) {
+ return defaultTaxonService.findBestMatchingTaxon(config);
+ }
+
+ /**
+ * @param taxonName
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findBestMatchingSynonym(java.lang.String)
+ */
+ @Override
+ public Synonym findBestMatchingSynonym(String taxonName) {
+ return defaultTaxonService.findBestMatchingSynonym(taxonName);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getUuidAndTitleCacheTaxon()
+ */
+ @Override
+ public List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheTaxon() {
+ return defaultTaxonService.getUuidAndTitleCacheTaxon();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getUuidAndTitleCacheSynonym()
+ */
+ @Override
+ public List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheSynonym() {
+ return defaultTaxonService.getUuidAndTitleCacheSynonym();
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxaAndNamesForEditor(eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator)
+ */
+ @Override
+ public List<UuidAndTitleCache<TaxonBase>> findTaxaAndNamesForEditor(IFindTaxaAndNamesConfigurator configurator) {
+ return defaultTaxonService.findTaxaAndNamesForEditor(configurator);
+ }
+
+ /**
+ * @param taxon
+ * @param tree
+ * @param type
+ * @param doWithMisappliedNames
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#createInferredSynonyms(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.Classification, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType, boolean)
+ */
+ @Override
+ public List<Synonym> createInferredSynonyms(Taxon taxon, Classification tree, SynonymRelationshipType type, boolean doWithMisappliedNames) {
+ return defaultTaxonService.createInferredSynonyms(taxon, tree, type, doWithMisappliedNames);
+ }
+
+ /**
+ * @param taxon
+ * @param tree
+ * @param doWithMisappliedNames
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#createAllInferredSynonyms(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.Classification, boolean)
+ */
+ @Override
+ public List<Synonym> createAllInferredSynonyms(Taxon taxon, Classification tree, boolean doWithMisappliedNames) {
+ return defaultTaxonService.createAllInferredSynonyms(taxon, tree, doWithMisappliedNames);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonym(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator)
+ */
+ @Override
+ public void deleteSynonym(Synonym arg0, SynonymDeletionConfigurator arg1) {
+ defaultTaxonService.deleteSynonym(arg0, arg1);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonym(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator)
+ */
+ @Override
+ public void deleteSynonym(Synonym arg0, Taxon arg1, SynonymDeletionConfigurator arg2) {
+ defaultTaxonService.deleteSynonym(arg0, arg1, arg2);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator, eu.etaxonomy.cdm.model.taxon.Classification)
+ */
+ @Override
+ public void deleteTaxon(Taxon arg0, TaxonDeletionConfigurator arg1, Classification arg2)
+ throws DataChangeNoRollbackException {
+ defaultTaxonService.deleteTaxon(arg0, arg1, arg2);
+ }
+
+
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.transientServices;
+
+import java.net.URI;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.hibernate.LockMode;
+import org.hibernate.Session;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.envers.query.criteria.AuditCriterion;
+
+import eu.etaxonomy.cdm.api.service.DeleteResult;
+import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TermDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.ISourceable;
+import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+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.LanguageStringBase;
+import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.common.Representation;
+import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
+import eu.etaxonomy.cdm.model.location.NamedAreaType;
+import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.view.AuditEvent;
+import eu.etaxonomy.cdm.model.view.AuditEventRecord;
+import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.query.Grouping;
+import eu.etaxonomy.cdm.persistence.query.MatchMode;
+import eu.etaxonomy.cdm.persistence.query.OrderHint;
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+
+/**
+ * @author pplitzner
+ * @date 27.09.2013
+ *
+ */
+public class TransientTermService implements ITermService {
+
+ private ITermService defaultTermService;
+
+ /**
+ * @param defaultTermService
+ */
+ public TransientTermService(ITermService defaultTermService) {
+ this.defaultTermService = defaultTermService;
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<DefinedTermBase>> pageAuditEvents(DefinedTermBase t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultTermService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
+ }
+
+ /**
+ * @param annotatedObj
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Annotation> getAnnotations(DefinedTermBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTermService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IService#clear()
+ */
+ @Override
+ public void clear() {
+ defaultTermService.clear();
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
+ */
+ @Override
+ public void lock(DefinedTermBase t, LockMode lockMode) {
+ defaultTermService.lock(t, lockMode);
+ }
+
+ /**
+ * @param uri
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#getByUri(java.net.URI)
+ */
+ @Override
+ public DefinedTermBase getByUri(URI uri) {
+ return defaultTermService.getByUri(uri);
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @param propertyPaths
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
+ */
+ @Override
+ public void refresh(DefinedTermBase t, LockMode lockMode, List<String> propertyPaths) {
+ defaultTermService.refresh(t, lockMode, propertyPaths);
+ }
+
+ /**
+ * @param languageData
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#saveLanguageData(eu.etaxonomy.cdm.model.common.LanguageStringBase)
+ */
+ @Override
+ public UUID saveLanguageData(LanguageStringBase languageData) {
+ return null;
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#getAllLanguageStrings(int, int)
+ */
+ @Override
+ public List<LanguageString> getAllLanguageStrings(int limit, int start) {
+ return defaultTermService.getAllLanguageStrings(limit, start);
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#getAllRepresentations(int, int)
+ */
+ @Override
+ public List<Representation> getAllRepresentations(int limit, int start) {
+ return defaultTermService.getAllRepresentations(limit, start);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache()
+ */
+ @Override
+ public void updateTitleCache() {
+ defaultTermService.updateTitleCache();
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<DefinedTermBase> getNextAuditEvent(DefinedTermBase t) {
+ return defaultTermService.getNextAuditEvent(t);
+ }
+
+ /**
+ * @param iso639
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#getLanguageByIso(java.lang.String)
+ */
+ @Override
+ public Language getLanguageByIso(String iso639) {
+ return defaultTermService.getLanguageByIso(iso639);
+ }
+
+ /**
+ * @param locales
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#getLanguagesByLocale(java.util.Enumeration)
+ */
+ @Override
+ public List<Language> getLanguagesByLocale(Enumeration<Locale> locales) {
+ return defaultTermService.getLanguagesByLocale(locales);
+ }
+
+ /**
+ * @param tdwgAbbreviation
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#getAreaByTdwgAbbreviation(java.lang.String)
+ */
+ @Override
+ public NamedArea getAreaByTdwgAbbreviation(String tdwgAbbreviation) {
+ return defaultTermService.getAreaByTdwgAbbreviation(tdwgAbbreviation);
+ }
+
+ /**
+ * @param annotatableEntity
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Marker> getMarkers(DefinedTermBase annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTermService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param definedTerm
+ * @param pageSize
+ * @param pageNumber
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#getMedia(eu.etaxonomy.cdm.model.common.DefinedTermBase, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public Pager<Media> getMedia(DefinedTermBase definedTerm, Integer pageSize, Integer pageNumber) {
+ return defaultTermService.getMedia(definedTerm, pageSize, pageNumber);
+ }
+
+ /**
+ * @param clazz
+ * @param stepSize
+ * @param cacheStrategy
+ * @param monitor
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor)
+ */
+ @Override
+ public void updateTitleCache(Class<? extends DefinedTermBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<DefinedTermBase> cacheStrategy, IProgressMonitor monitor) {
+ defaultTermService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor);
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<DefinedTermBase> getPreviousAuditEvent(DefinedTermBase t) {
+ return defaultTermService.getPreviousAuditEvent(t);
+ }
+
+ /**
+ * @param clazz
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class)
+ */
+ @Override
+ public int count(Class<? extends DefinedTermBase> clazz) {
+ return defaultTermService.count(clazz);
+ }
+
+ /**
+ * @param level
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#list(eu.etaxonomy.cdm.model.location.NamedAreaLevel, eu.etaxonomy.cdm.model.location.NamedAreaType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<NamedArea> list(NamedAreaLevel level, NamedAreaType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTermService.list(level, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param from
+ * @param to
+ * @param criteria
+ * @param pageSize
+ * @param pageValue
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<DefinedTermBase>> pageAuditEvents(Class<? extends DefinedTermBase> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultTermService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths);
+ }
+
+ /**
+ * @param lsid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID)
+ */
+ @Override
+ public DefinedTermBase find(LSID lsid) {
+ return defaultTermService.find(lsid);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID delete(DefinedTermBase persistentObject) {
+ return defaultTermService.delete(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Object[]> groupMarkers(Class<? extends DefinedTermBase> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultTermService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID)
+ */
+ @Override
+ public boolean exists(UUID uuid) {
+ return defaultTermService.exists(uuid);
+ }
+
+ /**
+ * @param x
+ * @param y
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
+ */
+ @Override
+ public DefinedTermBase replace(DefinedTermBase x, DefinedTermBase y) {
+ return defaultTermService.replace(x, y);
+ }
+
+ /**
+ * @param definedTerm
+ * @param pageSize
+ * @param pageNumber
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#getGeneralizationOf(eu.etaxonomy.cdm.model.common.DefinedTermBase, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public <T extends DefinedTermBase> Pager<T> getGeneralizationOf(T definedTerm, Integer pageSize, Integer pageNumber) {
+ return defaultTermService.getGeneralizationOf(definedTerm, pageSize, pageNumber);
+ }
+
+ /**
+ * @param uuidSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set)
+ */
+ @Override
+ public List<DefinedTermBase> find(Set<UUID> uuidSet) {
+ return defaultTermService.find(uuidSet);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<IdentifiableSource> getSources(DefinedTermBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultTermService.getSources(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID)
+ */
+ @Override
+ public DefinedTermBase find(UUID uuid) {
+ return defaultTermService.find(uuid);
+ }
+
+ /**
+ * @param definedTerms
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#getPartOf(java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public <T extends DefinedTermBase> Pager<T> getPartOf(Set<T> definedTerms, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultTermService.getPartOf(definedTerms, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(int)
+ */
+ @Override
+ public DefinedTermBase find(int id) {
+ return defaultTermService.find(id);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<Rights> getRights(DefinedTermBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultTermService.getRights(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean)
+ */
+ @Override
+ public int countMarkers(Class<? extends DefinedTermBase> clazz, Boolean technical) {
+ return defaultTermService.countMarkers(clazz, technical);
+ }
+
+ /**
+ * @param idSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set)
+ */
+ @Override
+ public List<DefinedTermBase> findById(Set<Integer> idSet) {
+ return defaultTermService.findById(idSet);
+ }
+
+ /**
+ * @param definedTerms
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#getIncludes(java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public <T extends DefinedTermBase> Pager<T> getIncludes(Set<T> definedTerms, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultTermService.getIncludes(definedTerms, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param idInSource
+ * @param idNamespace
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String)
+ */
+ @Override
+ public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
+ return defaultTermService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#getSession()
+ */
+ @Override
+ public Session getSession() {
+ return defaultTermService.getSession();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<DefinedTermBase>> getUuidAndTitleCache() {
+ return defaultTermService.getUuidAndTitleCache();
+ }
+
+ /**
+ * @param clazz
+ * @param limit
+ * @param start
+ * @param groups
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Object[]> group(Class<? extends DefinedTermBase> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) {
+ return defaultTermService.group(clazz, limit, start, groups, propertyPaths);
+ }
+
+ /**
+ * @param label
+ * @param clazz
+ * @param pageSize
+ * @param pageNumber
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#findByRepresentationText(java.lang.String, java.lang.Class, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public <T extends DefinedTermBase> Pager<T> findByRepresentationText(String label, Class<T> clazz, Integer pageSize, Integer pageNumber) {
+ return defaultTermService.findByRepresentationText(label, clazz, pageSize, pageNumber);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<DefinedTermBase> findByTitle(Class<? extends DefinedTermBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTermService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param abbrev
+ * @param clazz
+ * @param pageSize
+ * @param pageNumber
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#findByRepresentationAbbreviation(java.lang.String, java.lang.Class, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public <T extends DefinedTermBase> Pager<T> findByRepresentationAbbreviation(String abbrev, Class<T> clazz, Integer pageSize, Integer pageNumber) {
+ return defaultTermService.findByRepresentationAbbreviation(abbrev, clazz, pageSize, pageNumber);
+ }
+
+ /**
+ * @param type
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<DefinedTermBase> list(Class<? extends DefinedTermBase> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTermService.list(type, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#listByTermClass(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public <TERM extends DefinedTermBase> List<TERM> listByTermClass(Class<TERM> clazz, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTermService.listByTermClass(clazz, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param term
+ * @param config
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITermService#delete(eu.etaxonomy.cdm.model.common.DefinedTermBase, eu.etaxonomy.cdm.api.service.config.TermDeletionConfigurator)
+ */
+ @Override
+ public DeleteResult delete(DefinedTermBase term, TermDeletionConfigurator config) {
+ return defaultTermService.delete(term, config);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Pager<DefinedTermBase> findByTitle(IIdentifiableEntityServiceConfigurator<DefinedTermBase> configurator) {
+ return defaultTermService.findByTitle(configurator);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
+ */
+ @Override
+ public Integer countByTitle(Class<? extends DefinedTermBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) {
+ return defaultTermService.countByTitle(clazz, queryString, matchmode, criteria);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID)
+ */
+ @Override
+ public DefinedTermBase load(UUID uuid) {
+ return defaultTermService.load(uuid);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List)
+ */
+ @Override
+ public DefinedTermBase load(UUID uuid, List<String> propertyPaths) {
+ return defaultTermService.load(uuid, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Integer countByTitle(IIdentifiableEntityServiceConfigurator<DefinedTermBase> configurator) {
+ return defaultTermService.countByTitle(configurator);
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public DefinedTermBase merge(DefinedTermBase transientObject) {
+ return defaultTermService.merge(transientObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<DefinedTermBase> listByTitle(Class<? extends DefinedTermBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTermService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<DefinedTermBase> page(Class<? extends DefinedTermBase> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTermService.page(type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID refresh(DefinedTermBase persistentObject) {
+ return defaultTermService.refresh(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<DefinedTermBase> listByReferenceTitle(Class<? extends DefinedTermBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTermService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param tableName
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int)
+ */
+ @Override
+ public List<DefinedTermBase> rows(String tableName, int limit, int start) {
+ return defaultTermService.rows(tableName, limit, start);
+ }
+
+ /**
+ * @param newInstances
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, DefinedTermBase> save(Collection<DefinedTermBase> newInstances) {
+ return null;
+ }
+
+ /**
+ * @param newInstance
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID save(DefinedTermBase newInstance) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID saveOrUpdate(DefinedTermBase transientObject) {
+ return null;
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<DefinedTermBase> search(Class<? extends DefinedTermBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTermService.search(clazz, queryString, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param transientObjects
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, DefinedTermBase> saveOrUpdate(Collection<DefinedTermBase> transientObjects) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID update(DefinedTermBase transientObject) {
+ return defaultTermService.update(transientObject);
+ }
+
+ /**
+ * @param example
+ * @param includeProperties
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<DefinedTermBase> list(DefinedTermBase example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTermService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param matchStrategy
+ * @param mergeStrategy
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy)
+ */
+ @Override
+ public int deduplicate(Class<? extends DefinedTermBase> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) {
+ return defaultTermService.deduplicate(clazz, matchStrategy, mergeStrategy);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param matchMode
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode)
+ */
+ @Override
+ public Pager<DefinedTermBase> findTitleCache(Class<? extends DefinedTermBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) {
+ return defaultTermService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode);
+ }
+
+
+
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.wizard;
+
+import org.apache.log4j.Logger;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+import eu.etaxonomy.cdm.ext.biocase.BioCaseQuery;
+import eu.etaxonomy.taxeditor.dataimport.DataImportEditor;
+import eu.etaxonomy.taxeditor.dataimport.DerivedUnitEditorInput;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * Wizard for querying BioCASe provider.
+ * @author pplitzner
+ * @date 11.09.2013
+ *
+ */
+public class SpecimenSearchWizard extends Wizard implements IImportWizard {
+ @SuppressWarnings("unused")
+ private static final Logger logger = Logger.getLogger(SpecimenSearchWizard.class);
+
+ private BioCaseQuery query;
+ private SpecimenSearchWizardPage searchPage;
+
+ /**
+ * Creates a new SpecimenSearchWizard
+ */
+ public SpecimenSearchWizard() {
+ //default constructor needed for RCP extension points
+
+ //check if connected to a data source. If not this will open an error dialog
+ CdmStore.getCurrentApplicationConfiguration();
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ @Override
+ public boolean performFinish() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+
+ try {
+ query = searchPage.getQuery();
+ DerivedUnitEditorInput input = new DerivedUnitEditorInput(query);
+ page.openEditor(input, DataImportEditor.ID, true);
+ } catch ( PartInitException e ) {
+ //Put your exception handler here if you wish to
+ }
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
+ */
+ @Override
+ public void addPages() {
+ addPage(searchPage);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ query = new BioCaseQuery();
+ searchPage = new SpecimenSearchWizardPage("Specimen Search");
+ }
+
+ /**
+ * Return a {@link BioCaseQuery} with the parameters entered in the wizard
+ * @return the query
+ */
+ public BioCaseQuery getQuery() {
+ return query;
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.wizard;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Composite;
+
+import eu.etaxonomy.cdm.ext.biocase.BioCaseQuery;
+import eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchController;
+
+
+/**
+ * Wizard page for entering search parameters
+ * @author pplitzner
+ * @date 12.09.2013
+ *
+ */
+public class SpecimenSearchWizardPage extends WizardPage{
+
+ private SpecimenSearchController specimenSearchController;
+
+ protected SpecimenSearchWizardPage(String pageName) {
+ super(pageName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl(Composite parent) {
+ specimenSearchController = new SpecimenSearchController(parent);
+ setControl(specimenSearchController.getComposite());
+ }
+
+ /**
+ * Returns a {@link BioCaseQuery} filled with the parameters defined in this wizard page
+ * @return
+ */
+ public BioCaseQuery getQuery() {
+ BioCaseQuery query = new BioCaseQuery();
+ query.accessionNumber = specimenSearchController.getAccessionNumber();
+ query.collector = specimenSearchController.getCollector();
+ query.collectorsNumber = specimenSearchController.getCollectorNumber();
+ query.country = specimenSearchController.getCountry();
+// query.date = specimenSearchController.getDate();
+ query.herbarium = specimenSearchController.getHerbarium();
+ query.locality = specimenSearchController.getLocality();
+ query.taxonName = specimenSearchController.getTaxonName();
+ return query;
+ }
+
+}
<classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.3.0-SNAPSHOT-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.3.0-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.3.0-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.3.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.3.0-SNAPSHOT.jar" sourcepath="lib/cdmlib-ext-3.3.0-SNAPSHOT-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.3.0-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.3.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.3.0-SNAPSHOT.jar" sourcepath="lib/cdmlib-io-3.3.0-SNAPSHOT-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.3.0-SNAPSHOT-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.3.0-SNAPSHOT.jar" sourcepath="lib/cdmlib-model-3.3.0-SNAPSHOT-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.3.0-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.3.0-SNAPSHOT.jar" sourcepath="lib/cdmlib-persistence-3.3.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.3.0-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.3.0-SNAPSHOT-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.3.0-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.3.0-SNAPSHOT-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/solr-core-3.6.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/solr-solrj-3.6.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/spring-aop-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/spring-beans-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/spring-beans-3.2.2.RELEASE.jar" sourcepath="/home/pplitzner/.m2/repository/org/springframework/org.springframework.beans/3.2.2.RELEASE/org.springframework.beans-3.2.2.RELEASE-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/spring-context-3.2.2.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="lib/spring-context-support-3.2.2.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="lib/spring-core-3.2.2.RELEASE.jar"/>
eu.etaxonomy.cdm.database.update.v25_30,
eu.etaxonomy.cdm.database.update.v30_31,
eu.etaxonomy.cdm.ext.bci,
+ eu.etaxonomy.cdm.ext.biocase,
eu.etaxonomy.cdm.ext.common,
eu.etaxonomy.cdm.ext.dc,
eu.etaxonomy.cdm.ext.geo,
org.apache.commons.lang;uses:="org.apache.commons.lang.exception",
org.apache.fop.apps,
org.apache.http,
+ org.apache.http.client,
org.apache.log4j;uses:="org.apache.log4j.helpers,org.apache.log4j.or,org.apache.log4j.spi",
org.apache.log4j.chainsaw;
uses:="org.apache.log4j,
org.apache.log4j.spi,
org.w3c.dom,
org.xml.sax",
+ org.apache.lucene.index,
+ org.apache.lucene.queryParser,
org.apache.lucene.util,
org.apache.sanselan;uses:="org.apache.sanselan.common,org.apache.sanselan.common.byteSources",
org.apache.xerces.dom,
org.hibernate.annotations.common.reflection,
org.hibernate.cache.internal,
org.hibernate.classic,
+ org.hibernate.criterion,
+ org.hibernate.envers.query.criteria,
org.hibernate.search,
+ org.hibernate.search.spatial.impl,
org.jadira.usertype.dateandtime.joda,
org.jadira.usertype.dateandtime.shared.spi,
org.jboss.logging,
lib/yjp-controller-api-redist-9.0.8.jar,
lib/google-api-translate-java-0.92.jar,
lib/odfdom-0.8.jar,
- lib/h2mig_pagestore_addon.jar
+ lib/h2mig_pagestore_addon.jar,
+ lib/cdmlib-commons-3.2.4-SNAPSHOT-sources.jar,
+ lib/cdmlib-commons-3.2.4-SNAPSHOT.jar,
+ lib/cdmlib-ext-3.2.4-SNAPSHOT-sources.jar,
+ lib/cdmlib-ext-3.2.4-SNAPSHOT.jar,
+ lib/cdmlib-io-3.2.4-SNAPSHOT-sources.jar,
+ lib/cdmlib-io-3.2.4-SNAPSHOT.jar,
+ lib/cdmlib-model-3.2.4-SNAPSHOT-sources.jar,
+ lib/cdmlib-model-3.2.4-SNAPSHOT.jar,
+ lib/cdmlib-persistence-3.2.4-SNAPSHOT-sources.jar,
+ lib/cdmlib-persistence-3.2.4-SNAPSHOT.jar,
+ lib/cdmlib-print-3.2.4-SNAPSHOT-sources.jar,
+ lib/cdmlib-print-3.2.4-SNAPSHOT.jar,
+ lib/cdmlib-remote-3.2.4-SNAPSHOT-sources.jar,
+ lib/cdmlib-remote-3.2.4-SNAPSHOT.jar,
+ lib/cdmlib-services-3.2.4-SNAPSHOT-sources.jar,
+ lib/cdmlib-services-3.2.4-SNAPSHOT.jar
lib/yjp-controller-api-redist-9.0.8.jar,\\r
lib/google-api-translate-java-0.92.jar,\\r
lib/odfdom-0.8.jar,\\r
- lib/h2mig_pagestore_addon.jar\r
+ lib/h2mig_pagestore_addon.jar,\\r
+ lib/cdmlib-commons-3.2.4-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-commons-3.2.4-SNAPSHOT.jar,\\r
+ lib/cdmlib-ext-3.2.4-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-ext-3.2.4-SNAPSHOT.jar,\\r
+ lib/cdmlib-io-3.2.4-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-io-3.2.4-SNAPSHOT.jar,\\r
+ lib/cdmlib-model-3.2.4-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-model-3.2.4-SNAPSHOT.jar,\\r
+ lib/cdmlib-persistence-3.2.4-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-persistence-3.2.4-SNAPSHOT.jar,\\r
+ lib/cdmlib-print-3.2.4-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-print-3.2.4-SNAPSHOT.jar,\\r
+ lib/cdmlib-remote-3.2.4-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-remote-3.2.4-SNAPSHOT.jar,\\r
+ lib/cdmlib-services-3.2.4-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-services-3.2.4-SNAPSHOT.jar\r
\r
point="org.eclipse.ui.views">
<view
allowMultiple="false"
+ category="eu.etaxonomy.taxeditor.editor.category"
class="eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart"
icon="icons/address-book-new.png"
id="eu.etaxonomy.taxeditor.editor.view.descriptive"
restorable="true">
</view>
<view
- allowMultiple="false"
- class="eu.etaxonomy.taxeditor.editor.view.uses.UsesViewPart"
- icon="icons/leaf.png"
- id="eu.etaxonomy.taxeditor.editor.view.uses"
- name="Uses"
- restorable="true">
+ allowMultiple="false"
+ category="eu.etaxonomy.taxeditor.editor.category"
+ class="eu.etaxonomy.taxeditor.editor.view.uses.UsesViewPart"
+ icon="icons/leaf.png"
+ id="eu.etaxonomy.taxeditor.editor.view.uses"
+ name="Uses"
+ restorable="true">
</view>
<view
allowMultiple="false"
+ category="eu.etaxonomy.taxeditor.editor.category"
class="eu.etaxonomy.taxeditor.editor.view.media.MediaViewPart"
icon="icons/camera-photo.png"
id="eu.etaxonomy.taxeditor.editor.view.media"
restorable="true">
</view>
<view
+ category="eu.etaxonomy.taxeditor.editor.category"
class="eu.etaxonomy.taxeditor.editor.view.concept.ConceptViewPart"
id="eu.etaxonomy.taxeditor.editor.view.concept"
name="Concept Relations"
restorable="true">
</view>
<view
+ category="eu.etaxonomy.taxeditor.editor.category"
class="eu.etaxonomy.taxeditor.editor.view.concept.graph.ConceptGraphView"
icon="icons/address-book-new.png"
id="eu.etaxonomy.taxeditor.editor.view.concept.graph"
name="Concept Graph"
restorable="true">
</view>
+ <view
+ allowMultiple="false"
+ category="eu.etaxonomy.taxeditor.editor.category"
+ class="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
+ icon="icons/leaf_detail.png"
+ id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
+ name="Derivate View"
+ restorable="true">
+ </view>
+ <category
+ id="eu.etaxonomy.taxeditor.editor.category"
+ name="Taxonomic Editor">
+ </category>
</extension>
<extension
point="org.eclipse.ui.elementFactories">
style="push">
</command>
</menuContribution>
+ <menuContribution
+ locationURI="popup:eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
+ <menu
+ label="New Derivate">
+ <dynamic
+ class="eu.etaxonomy.taxeditor.editor.view.derivate.CreateDerivateContextMenu"
+ id="eu.etaxonomy.taxeditor.editor.view.derivate.CreateDerivateContextMenu">
+ </dynamic>
+ <visibleWhen
+ checkEnabled="true">
+ <reference
+ definitionId="isSpecimenOrObservation">
+ </reference>
+ </visibleWhen>
+ </menu>
+ </menuContribution>
</test>
</with>
</definition>
+ <definition
+ id="isSpecimenOrObservation">
+ <with
+ variable="selection">
+ <test
+ property="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateMenuPropertyTester.isSpecimenOrObservation">
+ </test>
+ </with>
+ </definition>
</extension>
<extension
point="org.eclipse.core.expressions.propertyTesters">
properties="isGroup"
type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">
</propertyTester>
+ <propertyTester
+ class="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateMenuPropertyTester"
+ id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateMenuPropertyTester"
+ namespace="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateMenuPropertyTester"
+ properties="isSpecimenOrObservation"
+ type="org.eclipse.jface.viewers.TreeSelection">
+ </propertyTester>
</extension>
<extension
point="org.eclipse.ui.bindings">
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.view.derivate;
+
+import org.eclipse.jface.action.ContributionItem;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.CompoundContributionItem;
+import org.eclipse.ui.handlers.IHandlerService;
+
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+
+public class CreateDerivateContextMenu extends CompoundContributionItem {
+
+ private final IHandlerService handlerService = (IHandlerService) EditorUtil.getService(IHandlerService.class);
+ private final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ private final ISelection selection = window.getActivePage().getSelection();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
+ */
+ @Override
+ protected IContributionItem[] getContributionItems() {
+ IContributionItem[] contributionItems = new IContributionItem[] {
+ new ContributionItem() {
+ @Override
+ public void fill(Menu menu, int index) {
+ if(selection instanceof TreeSelection){
+ final Object selectedElement = ((TreeSelection) selection).getFirstElement();
+ //context menu for FieldUnit
+ if(selectedElement instanceof FieldUnit){
+ MenuItem createSpecimen = new MenuItem(menu, SWT.None);
+ createSpecimen.setText("Specimen");
+ createSpecimen.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FieldUnit fieldUnit = HibernateProxyHelper.deproxy(selectedElement, FieldUnit.class);
+ DerivedUnit specimen = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
+ fieldUnit.addDerivationEvent(DerivationEvent.NewSimpleInstance(fieldUnit, specimen, DerivationEventType.GATHERING_IN_SITU()));
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+ MenuItem createLivingPlantPhoto = new MenuItem(menu, SWT.None);
+ createLivingPlantPhoto.setText("Living Plant Photo");
+ }
+ //context menu for Specimen
+ else if(selectedElement instanceof DerivedUnit && ((DerivedUnit)selectedElement).getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
+ MenuItem createTissueSample = new MenuItem(menu, SWT.None);
+ createTissueSample.setText("Tissue Sample");
+ MenuItem createDNASample = new MenuItem(menu, SWT.None);
+ createDNASample.setText("DNA Sample");
+ MenuItem createSpecimenScan = new MenuItem(menu, SWT.None);
+ createSpecimenScan.setText("Specimen Scan");
+ MenuItem createArtwork = new MenuItem(menu, SWT.None);
+ createArtwork.setText("Artwork");
+ MenuItem createLivingPlantPhoto = new MenuItem(menu, SWT.None);
+ createLivingPlantPhoto.setText("Living Plant Photo");
+ }
+ else{
+ MenuItem menuItem = new MenuItem(menu, SWT.None);
+ menuItem.setText("No child derivates");
+ menuItem.setEnabled(false);
+ }
+ }
+ }
+ }
+ };
+ return contributionItems;
+ }
+
+}
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.view.derivate;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+
+public class DerivateContentProvider implements ITreeContentProvider {
+
+ @Override
+ public void dispose() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ // return the parent FieldUnit if element is a DerivedUnit
+ if(inputElement instanceof DerivedUnit){
+ DerivedUnit derivedUnit = (DerivedUnit)inputElement;
+ for(SpecimenOrObservationBase original:derivedUnit.getOriginals()){
+ if(original instanceof FieldUnit){
+ return Collections.singletonList(original).toArray();
+ }
+ else{
+ return getElements(original);
+ }
+ }
+ }
+ // return the FieldUnit itself if element is a FieldUnit (used clone() due to recursion issues -> see javadoc of this method)
+ else if(inputElement instanceof FieldUnit){
+ FieldUnit fieldUnit = ((FieldUnit) inputElement).clone();
+ fieldUnit.getTitleCache();
+ return Collections.singleton(fieldUnit).toArray();
+ }
+ return Collections.EMPTY_LIST.toArray();
+ }
+
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ if(parentElement instanceof SpecimenOrObservationBase){
+ return getDerivates((SpecimenOrObservationBase) parentElement).toArray();
+ }
+ return null;
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ if(element instanceof DerivedUnit){
+ DerivedUnit derivedUnit = (DerivedUnit)element;
+ return derivedUnit.getOriginalUnit();
+ }
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ if(element instanceof SpecimenOrObservationBase){
+ SpecimenOrObservationBase specimenOrObservation = (SpecimenOrObservationBase)element;
+ for(DerivationEvent event:(Set<DerivationEvent>)specimenOrObservation.getDerivationEvents()){
+ if(!event.getDerivatives().isEmpty()){
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private List<DerivedUnit> getDerivates(SpecimenOrObservationBase specimenOrObservation){
+ List<DerivedUnit> derivates = new ArrayList<DerivedUnit>();
+ for(DerivationEvent derivationEvent:(Set<DerivationEvent>)specimenOrObservation.getDerivationEvents()){
+ derivates.addAll(derivationEvent.getDerivatives());
+ }
+ return derivates;
+ }
+
+}
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.view.derivate;
+
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.swt.graphics.Image;
+
+public class DerivateLabelProvider extends ColumnLabelProvider implements IStyledLabelProvider {
+
+ @Override
+ public StyledString getStyledText(Object element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object element) {
+ return super.getText(element);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ColumnLabelProvider#getImage(java.lang.Object)
+ */
+ @Override
+ public Image getImage(Object element) {
+ return super.getImage(element);
+ }
+
+}
--- /dev/null
+/**
+ *
+ */
+package eu.etaxonomy.taxeditor.editor.view.derivate;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+
+/**
+ * Property tester used by the DerivateView tree menu.
+ *
+ */
+public class DerivateMenuPropertyTester extends PropertyTester {
+
+ private static final String IS_SPECIMEN_OR_OBSERVATION = "isSpecimenOrObservation";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ //TODO: these simple instanceof-checks can be unified in one class because there are several
+ // PropertyTesters that do the same, that is just checking which class the selection is of
+
+ Object[] selectedElements = ((IStructuredSelection) receiver).toArray();
+
+ if(selectedElements.length == 0){
+ // nothing selected so all tests should fail
+ return false;
+ }
+
+ if(IS_SPECIMEN_OR_OBSERVATION.equals(property)){
+ return isSpecimenOrObservation(selectedElements);
+ }
+ else{
+ return false;
+ }
+ }
+
+ private boolean isSpecimenOrObservation(Object[] selectedElements) {
+ for (Object object : selectedElements){
+ if(!(object instanceof SpecimenOrObservationBase)){
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.view.derivate;
+
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.IWorkbenchPart;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
+import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
+
+/**
+ * Displays the derivate hierarchy of all derivates belonging to a taxon.
+ *
+ */
+public class DerivateView extends AbstractCdmEditorViewPart implements IPartContentHasDetails, IPartContentHasSupplementalData {
+
+ /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.desc"{trunked}</code> */
+ public static final String ID = "eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView";
+
+ protected TreeViewer viewer;
+
+ @Override
+ public void createViewer(Composite parent) {
+ viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION));
+ viewer.setContentProvider(new DerivateContentProvider());
+ viewer.setLabelProvider(new DerivateLabelProvider());
+ viewer.setAutoExpandLevel(2);
+ // Propagate selection from viewer
+ getSite().setSelectionProvider(viewer);
+
+ //create context menu
+ MenuManager menuManager = new MenuManager();
+
+ getSite().registerContextMenu(menuManager, viewer);
+
+ Control control = viewer.getControl();
+ Menu menu = menuManager.createContextMenu(control);
+
+ control.setMenu(menu);
+ }
+
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if(AbstractUtility.getActiveEditor()==null || !(AbstractUtility.getActiveEditor() instanceof BulkEditor)){
+ showEmptyPage();
+ return;
+ }
+ else if(part instanceof BulkEditor && selection instanceof IStructuredSelection){
+ showViewer(part, (IStructuredSelection)selection);
+ return;
+ }
+ }
+
+ @Override
+ public boolean onComplete() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public Viewer getViewer() {
+ return viewer;
+ }
+
+
+ @Override
+ public boolean postOperation(CdmBase objectAffectedByOperation) {
+ return super.postOperation(objectAffectedByOperation);
+ }
+
+
+}
/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.editor.view.descriptive;
* @version $Id: $
*/
public class DescriptiveContentProvider implements ITreeContentProvider {
-
+
protected static final Object[] NO_CHILDREN = new Object[0];
protected Map<TaxonDescription, FeatureNodeContainerTree> featureNodeContainerCache;
-
+
/**
* <p>Constructor for DescriptiveContentProvider.</p>
*
public DescriptiveContentProvider(Map<TaxonDescription, FeatureNodeContainerTree> featureNodeContainerCache) {
this.featureNodeContainerCache = featureNodeContainerCache;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
/** {@inheritDoc} */
- public Object[] getChildren(Object parentElement) {
+ @Override
+ public Object[] getChildren(Object parentElement) {
if (parentElement instanceof TaxonEditorInput) {
- return getDescriptions((TaxonEditorInput) parentElement).toArray();
+ return getDescriptions((TaxonEditorInput) parentElement).toArray();
}
else if (parentElement instanceof TaxonDescription) {
if ( ! ((TaxonDescription) parentElement).isImageGallery()) {
TaxonDescription description = (TaxonDescription) parentElement;
-
+
FeatureNodeContainerTree containerTree = getContainerTreeForDesription(description);
-
+
return containerTree.getRoot().getChildren().toArray();
}
}
return container.getChildren().toArray();
}
}
-
+
return NO_CHILDREN;
}
-
+
private FeatureNodeContainerTree getContainerTreeForDesription(TaxonDescription description){
if(! featureNodeContainerCache.containsKey(description)){
FeatureNodeContainerTree containerTree = new FeatureNodeContainerTree(description, getFeatureTree(description));
if(containerTree != null && containerTree.getRoot() != null){
return containerTree.getRoot().getChildren().size() != 0;
}
- }
+ }
return getChildren(element).length != 0;
}
-
+
/**
* Retrieves the feature tree associated with the given description
- *
- * TODO as of now this is always the same thing because feature trees may not be associated
+ *
+ * TODO as of now this is always the same thing because feature trees may not be associated
* to descriptions yet.
- *
+ *
* @param description
* @return
*/
private FeatureTree getFeatureTree(DescriptionBase description){
FeatureTree featureTree = null;
-
+
// TODO change this to the feature tree associated with this taxon description
- if (description.hasStructuredData()){
+ if (description.hasStructuredData()){
featureTree = PreferencesUtil.getDefaultFeatureTreeForStructuredDescription();
}else{
featureTree = PreferencesUtil.getDefaultFeatureTreeForTextualDescription();
}
-
+
// create a transient tree with all features if none was selected
if(featureTree == null){
featureTree = FeatureTree.NewInstance(TermStore.getTerms(Feature.class));
}
-
+
return featureTree;
}
/**
* Get all descriptions associated with the given TaxonEditorInput
- *
+ *
* @param parentElement
* @return
*/
descriptions.add(description);
}
}
-
- }
+
+ }
return descriptions;
}
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
/** {@inheritDoc} */
- public Object getParent(Object element) {
+ @Override
+ public Object getParent(Object element) {
return null;
}
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
/** {@inheritDoc} */
- public Object[] getElements(Object inputElement) {
+ @Override
+ public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
/**
* <p>dispose</p>
*/
- public void dispose() {
+ @Override
+ public void dispose() {
featureNodeContainerCache.clear();
}
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
/** {@inheritDoc} */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
-
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+
}
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;
import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
/** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.desc"{trunked}</code> */
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.descriptive";
-
+
protected TreeViewer viewer;
-
+
+ /**
+ * Maps {@link FeatureNodeContainerTree} to their corresponding {@link TaxonDescritpion}.<br>
+ * This serves as input for the {@link ITreeContentProvider} of the {@link TreeViewer}
+ */
protected Map<TaxonDescription, FeatureNodeContainerTree> featureNodeContainerCache = new HashMap<TaxonDescription, FeatureNodeContainerTree>();
protected ToggleDescriptionAction showAllElementsAction;
protected ToggleDescriptionAction hideAllElementsAction;
protected int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
-
+
/** {@inheritDoc} */
@Override
public void createViewer(Composite parent) {
viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.FULL_SELECTION));
- viewer.setContentProvider(new DescriptiveContentProvider(featureNodeContainerCache));
+ viewer.setContentProvider(new DescriptiveContentProvider(featureNodeContainerCache));
viewer.setLabelProvider(new DescriptiveLabelProvider());
viewer.setSorter(new DescriptiveViewerSorter());
viewer.setAutoExpandLevel(2);
this));
viewer.addDropSupport(dndOperations, transfers,
new DescriptionElementDropAdapter(viewer));
-
+
// Propagate selection from viewer
getSite().setSelectionProvider(viewer);
-
- showAllElementsAction = new ToggleDescriptionAction(false);
+
+ showAllElementsAction = new ToggleDescriptionAction(false);
hideAllElementsAction = new ToggleDescriptionAction(true);
-
+
// Add context menu to tree
createMenu();
-
+
createToolbar();
-
+
// set initial input
// if(getEditor() != null){
// viewer.setInput(getEditor().getEditorInput());
// }
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#getInitialSelection()
*/
protected ISelection getInitialSelection() {
if(getEditor() != null){
return new StructuredSelection(getEditor().getEditorInput());
- }
-
+ }
+
return super.getInitialSelection();
}
toolBarManager.add(showAllElementsAction);
toolBarManager.add(hideAllElementsAction);
}
-
+
/*
* TODO add to the views menu
*/
protected void createMenu(){
MenuManager menuManager = new MenuManager();
menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-
+
getSite().registerContextMenu(menuManager, viewer);
// FIXME for some reason this is not working
menuManager.add(showAllElementsAction);
menuManager.add(hideAllElementsAction);
-
+
Control control = viewer.getControl();
Menu menu = menuManager.createContextMenu(control);
-
- control.setMenu(menu);
+
+ control.setMenu(menu);
}
/** {@inheritDoc} */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if(EditorUtil.getActiveEditor() == null){
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if(AbstractUtility.getActiveEditor() == null){
showEmptyPage();
return;
}
-
+
if(part instanceof BulkEditor){
showEmptyPage();
return;
}
-
+
if(part instanceof AbstractGraphKeyEditor){
showEmptyPage();
return;
}
-
+
if(part instanceof DefinedTermEditor){
showEmptyPage();
return;
}
-
+
if(part instanceof MultiPageTaxonEditor){
if(! part.equals(this.part)){
IEditorInput input = ((IEditorPart) part).getEditorInput();
featureNodeContainerCache.clear();
showViewer(part, new StructuredSelection(input));
}
- showViewer();
}
}
-
+
/**
- *
+ *
* @author n.hoffmann
* @created May 28, 2010
* @version 1.0
*/
protected class ToggleDescriptionAction extends Action{
- private boolean expanded;
-
+ private final boolean expanded;
+
public ToggleDescriptionAction(boolean expand){
- super(null, Action.AS_PUSH_BUTTON);
+ super(null, IAction.AS_PUSH_BUTTON);
expanded = expand;
setImageAndTooltip();
}
-
+
private void setImageAndTooltip(){
setImageDescriptor(new ImageDescriptor() {
@Override
return ImageResources.getImage(resource).getImageData();
}
});
-
+
String toolTipText = expanded ? "Collapse all" : "Show all descriptive data";
setToolTipText(toolTipText);
}
-
+
@Override
public void run() {
if(expanded){
containerTree.buildTree();
}
viewer.refresh();
-
+
if(object instanceof DescriptionElementBase){
DescriptionElementBase descriptionElement = (DescriptionElementBase) object;
DescriptionBase description = descriptionElement.getInDescription();
FeatureNodeContainerTree containerTree = featureNodeContainerCache.get(description);
-
+
FeatureNodeContainer featureNodeContainer = containerTree.getFeatureNodeContainerForDescriptionElement(descriptionElement);
viewer.expandToLevel(featureNodeContainer, 1);
-
+
}
if(object != null){
*
* @return a boolean.
*/
- public boolean onComplete() {
+ @Override
+ public boolean onComplete() {
return false;
}
}
/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.editor.view.descriptive.handler;
* @version $Id: $
*/
public class DescriptionsMenuPropertyTester extends PropertyTester {
-
+
private static final String MEDIA = "isMedia";
private static final String FEATURE_NODE_CONTAINER = "isFeatureNodeContainer";
private static final String DESCRIPTION = "isDescription";
private static final String DESCRIPTION_ELEMENT = "isDescriptionElement";
private static final String DELETABLE = "isDeletable";
private static final String IMAGE_GALLERY = "isImageGallery";
-
+
/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
/** {@inheritDoc} */
- public boolean test(Object receiver, String property, Object[] args,
+ @Override
+ public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
Object[] selectedElements = ((IStructuredSelection) receiver).toArray();
-
+
if(selectedElements.length == 0){
// nothing selected so all tests should fail
return false;
}
-
+
if(MEDIA.equals(property)){
return isMedia(selectedElements);
}
return false;
}
}
-
+
private boolean isImageGallery(Object[] selectedElements) {
- for (Object object : selectedElements){
+ for (Object object : selectedElements){
if(!(object instanceof DescriptionBase) || !((DescriptionBase) object).isImageGallery()){
return false;
}
private boolean isDeletable(Object[] selectedElements) {
boolean result = false;
-
+
for (Object object : selectedElements) {
-
+
if((object instanceof DescriptionBase)
|| (object instanceof DescriptionElementBase)
|| (object instanceof Media)
}else{
return false;
}
-
+
}
return result;
}
eu.etaxonomy.taxeditor.store.internal,
eu.etaxonomy.taxeditor.store.operations,
eu.etaxonomy.taxeditor.ui.bar,
+ eu.etaxonomy.taxeditor.ui.campanula.specimenSearch,
eu.etaxonomy.taxeditor.ui.combo,
eu.etaxonomy.taxeditor.ui.dialog,
eu.etaxonomy.taxeditor.ui.dialog.selection,
</command>
</menuContribution>
</extension>
- <extension
- name="Window Menu Commands"
- point="org.eclipse.ui.commands">
- <command
- defaultHandler="eu.etaxonomy.taxeditor.editor.definedterm.handler.OpenDefinedTermEditorHandler"
- id="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
- name="Open Defined Term Editor">
- <commandParameter
- id="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.parameter"
- name="inputType"
- optional="true">
- </commandParameter>
- <commandParameter
- id="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid"
- name="inputType"
- optional="true">
- </commandParameter>
- </command>
- </extension>
- <extension
- name="File Menu Commands"
- point="org.eclipse.ui.commands">
- <command
- defaultHandler="eu.etaxonomy.taxeditor.handler.ShowLoginWindowHandler"
- id="eu.etaxonomy.taxeditor.store.operations.showLoginWindow"
- name="Show Login Window">
- </command>
- </extension>
<extension
point="org.eclipse.ui.handlers">
<handler
id="eu.etaxonomy.taxeditor.store.datasource.update"
name="Update Datasource">
</command>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="eu.etaxonomy.taxeditor.handler.ShowLoginWindowHandler"
+ id="eu.etaxonomy.taxeditor.store.operations.showLoginWindow"
+ name="Show Login Window">
+ </command>
+ <command
+ defaultHandler="eu.etaxonomy.taxeditor.editor.definedterm.handler.OpenDefinedTermEditorHandler"
+ id="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
+ name="Open Defined Term Editor">
+ <commandParameter
+ id="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.parameter"
+ name="inputType"
+ optional="true">
+ </commandParameter>
+ <commandParameter
+ id="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid"
+ name="inputType"
+ optional="true">
+ </commandParameter>
+ </command>
<command
defaultHandler="eu.etaxonomy.taxeditor.editor.definedterm.handler.CreateDefinedTermHandler"
id="eu.etaxonomy.taxeditor.editor.definedTerms.newDefinedTerm"
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.model.common.OriginalSourceType;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.ui.dialog.selection.OriginalSourceTypeSelectionDialog;
-import eu.etaxonomy.taxeditor.ui.dialog.selection.SpecimenOrObservationTypeSelectionDialog;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseWizardPage;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationWizardPage;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventWizardPage;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.GeneralWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitDetailsWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationDetailsWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationGeneralWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailsWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenDetailsWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenGeneralWizardPage;
/**
* <p>NewDerivedUnitBaseWizard class.</p>
* @created Jun 16, 2010
* @version 1.0
*/
-public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<DerivedUnit> {
+public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<SpecimenOrObservationBase<?>> {
private SpecimenOrObservationType specOrObsType = null;
-
+
public NewDerivedUnitBaseWizard() {
- super();
+ super();
}
-
+
public NewDerivedUnitBaseWizard(SpecimenOrObservationType specOrObsType) {
super();
this.specOrObsType = specOrObsType;
}
/** {@inheritDoc} */
@Override
- public void addPages() {
- addPage(new GeneralWizardPage(formFactory, getConversationHolder(), getFacade()));
- addPage(new GatheringEventWizardPage(formFactory, getConversationHolder(), getFacade()));
- addPage(new FieldObservationWizardPage(formFactory, getConversationHolder(), getFacade()));
- addPage(new DerivedUnitBaseWizardPage(formFactory, getConversationHolder(), getFacade()));
-
- }
-
- /**
- * @return
- */
- private DerivedUnitFacade getFacade() {
- try {
- if(getEntity() != null) {
- return DerivedUnitFacade.NewInstance(getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
- }
- } catch (DerivedUnitFacadeNotSupportedException e) {
- // w should never get here
- throw new IllegalStateException();
- }
- return null;
- }
+ public void addPages() {
+ DerivedUnitFacade derivedUnitFacade = null;
+ try {
+ if (getEntity() != null) {
+ if(getEntity() instanceof FieldUnit){
+ derivedUnitFacade = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit)getEntity());
+
+ addPage(new FieldObservationGeneralWizardPage(formFactory, getConversationHolder(), derivedUnitFacade));
+ addPage(new GatheringEventDetailsWizardPage(formFactory, getConversationHolder(), derivedUnitFacade));
+ addPage(new FieldObservationDetailsWizardPage(formFactory, getConversationHolder(), derivedUnitFacade));
+ }
+ else if(getEntity() instanceof DerivedUnit){
+ derivedUnitFacade = DerivedUnitFacade.NewInstance((DerivedUnit)getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
+
+ addPage(new SpecimenGeneralWizardPage(formFactory, getConversationHolder(), derivedUnitFacade));
+ addPage(new SpecimenDetailsWizardPage(formFactory, getConversationHolder(), derivedUnitFacade));
+ addPage(new DerivedUnitDetailsWizardPage(formFactory, getConversationHolder(), derivedUnitFacade));
+ }
+ }
+ } catch (DerivedUnitFacadeNotSupportedException e) {
+ // we should never get here
+ throw new IllegalStateException();
+ }
+
+ }
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity()
*/
/** {@inheritDoc} */
@Override
- protected DerivedUnit createNewEntity() {
+ protected SpecimenOrObservationBase<?> createNewEntity() {
if(specOrObsType == null) {
return DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
- } else {
- if(SpecimenOrObservationType.Media.equals(specOrObsType) ||
- ((((SpecimenOrObservationType)specOrObsType).getKindOf() != null) &&
- ((SpecimenOrObservationType)specOrObsType).getKindOf().equals(SpecimenOrObservationType.Media))) {
+ } else {
+ if(SpecimenOrObservationType.Media.equals(specOrObsType) ||
+ ((specOrObsType.getKindOf() != null) &&
+ specOrObsType.getKindOf().equals(SpecimenOrObservationType.Media))) {
return MediaSpecimen.NewInstance(SpecimenOrObservationType.Media);
+ } else if(specOrObsType == SpecimenOrObservationType.FieldUnit){
+ return FieldUnit.NewInstance();
} else {
- return DerivedUnit.NewInstance((SpecimenOrObservationType)specOrObsType);
- }
+ return DerivedUnit.NewInstance(specOrObsType);
+ }
}
}
protected String getEntityName() {
return "Specimen";
}
-
-
+
+
}
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
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.key.PolytomousKeyDetailElement;
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2013 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.campanula.basicFields;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Listener;
+
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.store.TermManager;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
+import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
+import eu.etaxonomy.taxeditor.ui.element.ISelectable;
+
+/**
+ * @author pplitzner
+ * @date 15.08.2013
+ *
+ */
+public class ComboDefinedTermController<T extends DefinedTermBase> extends AbstractCdmFormElement implements SelectionListener, DisposeListener, IEnableableFormElement, ISelectable {
+
+ private static final int DEFAULT_VISIBLE_ITEMS = 10;
+
+ private T selection;
+
+ private T emptyElement;
+ private static String EMPTY_ELEMENT_LABEL = "";
+
+// protected Label label;
+ private Combo combo;
+
+ private ArrayList<T> terms;
+
+ private Comparator<T> termComparator;
+
+ private Class<T> termClass;
+
+ private List<T> customPreferredTerms;
+
+ /**
+ * <p>
+ * Constructor for AbstractTermComboElement.
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param style
+ * a int.
+ * @param formFactory
+ * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
+ * object.
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param selection
+ * a T object.
+ * @param visibleItems
+ * a int.
+ * @param <T>
+ * a T object.
+ */
+ public ComboDefinedTermController(Combo combo, CdmFormFactory formFactory, ICdmFormElement parentElement, Class<T> termClass, T selection, int style) {
+ super(formFactory, parentElement);
+
+ this.termClass = termClass;
+ setPropertyChangeListeners(formFactory.getPropertyChangeListeners());
+ formFactory.addPropertyChangeListener(this);
+// if (labelString != null) {
+// label = formFactory.createLabel(getLayoutComposite(), labelString);
+// addControl(label);
+// }
+
+ // create combo
+ this.combo = combo;//new Combo(getLayoutComposite(), SWT.BORDER | SWT.READ_ONLY);
+ addControl(combo);
+// combo.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
+ combo.setVisibleItemCount(DEFAULT_VISIBLE_ITEMS);
+
+ populateTerms(getPreferredTerms());
+
+ combo.addSelectionListener(this);
+ combo.addDisposeListener(this);
+ PreferencesUtil.getPreferenceStore().addPropertyChangeListener(this);
+
+ if (selection != null) {
+ setSelection(selection);
+ }
+ }
+
+ /**
+ * <p>
+ * Getter for the field <code>selection</code>.
+ * </p>
+ *
+ * @return a T object.
+ */
+ public T getSelection() {
+ return selection;
+ }
+
+ /**
+ * <p>
+ * Sets the selection of the combo to the given T object.
+ * </p>
+ * <p>
+ * Passing <code>null</code> to this method will set the selection to the
+ * empty element and effectively clear the selection
+ * </p>
+ *
+ * @param selection
+ * a T object or <code>null</code> to clear the selection
+ */
+ public void setSelection(T selection) {
+ this.selection = selection;
+
+ this.selection = selection;
+
+ Listener[] listeners = combo.getListeners(SWT.Selection);
+
+ for (Listener listener : listeners) {
+ combo.removeListener(SWT.Selection, listener);
+ }
+ int selectedIndex;
+ if (selection == null) {
+ // set selection to the emptyElement
+ selectedIndex = 0;
+ } else {
+ selectedIndex = terms.indexOf(selection);
+ if (selectedIndex == -1) {
+ createTermNotInPreferredTerms(selection);
+ selectedIndex = terms.indexOf(selection);
+ }
+ }
+ combo.select(selectedIndex);
+
+ for (Listener listener : listeners) {
+ combo.addListener(SWT.Selection, listener);
+ }
+ }
+
+ /**
+ * Fills the combo with elements and sets up the convenience functions for
+ * selection index
+ *
+ * @param preferredTerms
+ */
+ private void populateTerms(List<T> preferredTerms) {
+
+ combo.removeAll();
+
+ terms = new ArrayList<T>();
+
+ int i = 1;
+ int index = 0;
+
+ // Add an empty element for when nothing was selected yet
+ combo.add(EMPTY_ELEMENT_LABEL);
+ terms.add(emptyElement);
+
+ if (termComparator != null) {
+ Collections.sort(preferredTerms, termComparator);
+ }
+ for (T term : preferredTerms) {
+ String label = getLabel(term);
+ if (label == null) {
+ if (term.getTitleCache() != null) {
+ label = term.getTitleCache();
+ StoreUtil.warn(getClass(), "Term does not have a representation: " + term + ", " + term.getUuid());
+ } else {
+ label = "Unknown";
+ StoreUtil.warn(getClass(), "Representation Label and TitleCache empty for term: " + term + ", " + term.getUuid());
+ }
+
+ }
+
+ combo.add(label);
+ terms.add(term);
+
+ i++;
+ if (selection != null) {
+ if (selection.equals(term)) {
+ index = i;
+ }
+ }
+ }
+
+ if (selection != null && index == 0) {
+ createTermNotInPreferredTerms(selection);
+ }
+
+ combo.select(index);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.forms.IEnableableFormElement#setEnabled(boolean)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void setEnabled(boolean enabled) {
+ combo.setEnabled(enabled);
+ }
+
+ /**
+ * <p>
+ * preferredTerms
+ * </p>
+ *
+ * @return a {@link java.util.List} object.
+ */
+ protected List<T> getPreferredTerms() {
+ if (customPreferredTerms != null) {
+ return customPreferredTerms;
+ }
+ return getTermManager().getPreferredTerms(termClass);
+ }
+
+ /**
+ * May be overridden by derived classes if the desired label string does not
+ * reside in term.getLabel();
+ *
+ * @param term
+ * a T object.
+ * @return a {@link java.lang.String} object.
+ */
+ protected String getLabel(T term) {
+ return term.getLabel(CdmStore.getDefaultLanguage());
+ }
+
+ /**
+ *
+ *
+ * @param term
+ */
+ private void createTermNotInPreferredTerms(T term) {
+ List<T> preferredTerms = getPreferredTerms();
+
+ preferredTerms.add(term);
+
+ populateTerms(preferredTerms);
+ }
+
+ /**
+ * <p>
+ * addSelectionListener
+ * </p>
+ *
+ * @param listener
+ * a {@link org.eclipse.swt.events.SelectionListener} object.
+ */
+ public void addSelectionListener(SelectionListener listener) {
+ combo.addSelectionListener(listener);
+ }
+
+ /**
+ * <p>
+ * removeSelectionListener
+ * </p>
+ *
+ * @param listener
+ * a {@link org.eclipse.swt.events.SelectionListener} object.
+ */
+ public void removeSelectionListener(SelectionListener listener) {
+ combo.removeSelectionListener(listener);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt
+ * .events.SelectionEvent)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ selection = terms.get(combo.getSelectionIndex());
+ firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.beans.PropertyChangeListener#propertyChange(java.beans.
+ * PropertyChangeEvent)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
+ super.propertyChange(event);
+ if (event != null && PreferencesUtil.PREFERRED_TERMS_CHANGE.equals(event.getProperty())) {
+ populateTerms(getPreferredTerms());
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setSelected(boolean selected) {
+ setBackground(selected ? SELECTED : getPersistentBackground());
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ PreferencesUtil.getPreferenceStore().removePropertyChangeListener(this);
+ }
+
+ // not used
+ /** {@inheritDoc} */
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setIrrelevant(boolean irrelevant) {
+ String colorId = irrelevant ? Resources.COLOR_COMPOSITE_IRRELEVANT : Resources.COLOR_COMPOSITE_BACKGROUND;
+
+ Color color = StoreUtil.getColor(colorId);
+ combo.setBackground(color);
+ }
+
+// /** {@inheritDoc} */
+// @Override
+// public void setBackground(Color color) {
+// if (label != null)
+// label.setBackground(color);
+// }
+
+ /**
+*
+*/
+ protected TermManager getTermManager() {
+ return CdmStore.getTermManager();
+ }
+
+ /**
+ *
+ * @return
+ */
+ public int getVisibleItemCount() {
+ return combo.getVisibleItemCount();
+ }
+
+ /**
+ *
+ * @param count
+ */
+ public void setVisibleItemCount(int count) {
+ combo.setVisibleItemCount(count);
+ }
+
+ /**
+ * <p>
+ * A {@link List} of term objects may be passed to this combo box. In this
+ * case, the default behaviour of displaying the preferred terms for the T
+ * type will be overridden and the combo will only display the given terms.
+ * Also, any previous selection will be reseted.
+ * </p>
+ *
+ * <p>
+ * To return to the default of displaying the preferred terms, simply pass
+ * <code>null</code>.
+ * </p>
+ *
+ * @param terms
+ * a {@link List} of T objects or <code>null</code> for default
+ * preferred terms
+ */
+ public void setTerms(List<T> terms) {
+ setSelection(null);
+ customPreferredTerms = terms;
+ populateTerms(customPreferredTerms);
+ }
+}
\ No newline at end of file
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.basicFields;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.wb.swt.ResourceManager;
+import org.eclipse.wb.swt.SWTResourceManager;
+
+/**
+ * @author pplitzner
+ * @date 16.08.2013
+ *
+ */
+public class EntityCollectionElement extends ExpandableComposite {
+ private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public EntityCollectionElement(Composite parent, int style) {
+ super(parent, style);
+ setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
+ setExpanded(true);
+
+ ToolBar toolBar = new ToolBar(this, SWT.FLAT | SWT.RIGHT);
+ setTextClient(toolBar);
+
+ Label label = formToolkit.createLabel(this, "", SWT.NONE);
+ setClient(label);
+
+ 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() {
+// ELEMENT element = createNewElement();
+// if(element != null){
+// addElement(element);
+// if(! getSection().isExpanded()) {
+// getSection().setExpanded(true);
+// }
+// internalUpdateSection(true);
+// }
+ }
+ };
+ addAction.setImageDescriptor(ResourceManager.getPluginImageDescriptor("eu.etaxonomy.taxeditor.store", "icons/add_no_bg2.gif"));
+// addAction.setToolTipText(getTooltipString());
+
+ toolBarManager.add(addAction);
+
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.basicFields;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+import org.eclipse.wb.swt.ResourceManager;
+
+/**
+ * @author pplitzner
+ * @date 13.08.2013
+ *
+ */
+public class EntitySelectionField extends Composite {
+ private FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+ private Label text;
+ private Button button_selection;
+ private Button button_edit;
+ private Button button_remove;
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public EntitySelectionField(Composite parent, int style) {
+ super(parent, style);
+ setBackgroundMode(SWT.INHERIT_DEFAULT);
+ {
+ TableWrapLayout tableWrapLayout = new TableWrapLayout();
+ tableWrapLayout.verticalSpacing = 0;
+ tableWrapLayout.topMargin = 0;
+ tableWrapLayout.rightMargin = 0;
+ tableWrapLayout.numColumns = 4;
+ tableWrapLayout.leftMargin = 0;
+ tableWrapLayout.horizontalSpacing = 0;
+ tableWrapLayout.bottomMargin = 0;
+ setLayout(tableWrapLayout);
+ }
+
+ text = formToolkit.createLabel(this, "", SWT.WRAP);
+ TableWrapData twd_text = new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1);
+ twd_text.align = TableWrapData.LEFT;
+ text.setLayoutData(twd_text);
+
+ button_selection = formToolkit.createButton(this, "", SWT.NONE);
+ button_selection.setToolTipText("Browse existing");
+ button_selection.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/prj_obj.gif"));
+
+ button_edit = formToolkit.createButton(this, "", SWT.NONE);
+ button_edit.setToolTipText("Edit");
+ button_edit.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/text.gif"));
+
+ button_remove = formToolkit.createButton(this, "", SWT.NONE);
+ button_remove.setToolTipText("Remove");
+ button_remove.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/trash.gif"));
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+ public Label getText() {
+ return text;
+ }
+ public Button getButton_selection() {
+ return button_selection;
+ }
+ public Button getButton_edit() {
+ return button_edit;
+ }
+ public Button getButton_remove() {
+ return button_remove;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.widgets.Control#setEnabled(boolean)
+ */
+ @Override
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
+ text.setEnabled(enabled);
+ button_selection.setEnabled(enabled);
+ button_edit.setEnabled(enabled);
+ button_remove.setEnabled(enabled);
+ }
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2013 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.campanula.basicFields;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.springframework.security.core.GrantedAuthority;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.cdm.model.common.ICdmBase;
+import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.ImageResources;
+import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.IEntitySelectionElement;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
+import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
+import eu.etaxonomy.taxeditor.ui.selection.EditFromSelectionWizard;
+
+/**
+ * @author pplitzner
+ * @date 13.08.2013
+ *
+ */
+public class EntitySelectionFieldController<T extends ICdmBase> extends AbstractCdmFormElement implements IEntitySelectionElement<T>{
+
+ /**
+ * Bitmask for configuring functionality of selection element
+ */
+ public static final int NOTHING = 0; // 000
+ public static final int EDITABLE = 1 << 0; // 001
+ public static final int DELETABLE = 1 << 1; // 010
+ public static final int SELECTABLE = 1 << 2; // 100
+ public static final int ALL = EDITABLE | DELETABLE | SELECTABLE; // 111
+
+ protected T entity;
+
+ //TODO also control "label" with this class?
+// protected Label label;
+ protected Label text;
+ protected Button button_selection;
+
+ private SelectionArbitrator selectionArbitrator;
+
+ protected Button button_edit;
+
+// private final String labelString;
+
+ private Composite selectableComposite;
+
+ private Button button_remove;
+
+ private final boolean isEditable;
+
+ private final boolean isDeletable;
+
+ private final ConversationHolder conversation;
+ private Class<T> clazz;
+
+ /**
+ * <p>
+ * Constructor for AbstractSelectionElement.
+ * </p>
+ *
+ * @param formFactory
+ * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
+ * object.
+ * @param conversation
+ * TODO
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param entity
+ * a T object.
+ * @param isEditable
+ * a boolean.
+ * @param isSelectable
+ * a boolean.
+ * @param isDeletable
+ * a boolean.
+ * @param style
+ * a int.
+ * @param <T>
+ * a T object.
+ */
+ public EntitySelectionFieldController(EntitySelectionField entitySelectionField, CdmFormFactory formFactory, ConversationHolder conversation, ICdmFormElement parentElement, T entity, int mode) {
+ super(formFactory, parentElement);
+
+ setPropertyChangeListeners(formFactory.getPropertyChangeListeners());
+ formFactory.addPropertyChangeListener(this);
+
+ this.isEditable = (mode & EDITABLE) == EDITABLE;
+ this.isDeletable = (mode & DELETABLE) == DELETABLE;
+ boolean isSelectable = (mode & SELECTABLE) == SELECTABLE;
+
+// this.labelString = labelString;
+
+ this.conversation = conversation;
+
+ if (isSelectable && formFactory.getSelectionProvider() != null) {
+ selectionArbitrator = formFactory.createSelectionArbitrator(this);
+ }
+
+ createControls(entitySelectionField);
+
+ setEntity(entity);
+ }
+
+ public EntitySelectionFieldController(EntitySelectionField entitySelectionField, CdmFormFactory formFactory, ConversationHolder conversation, ICdmFormElement parentElement, Class<T> clazz, T entity, int mode) {
+ this(entitySelectionField, formFactory, conversation, parentElement, entity, mode);
+ this.clazz = clazz;
+ }
+
+ private void createControls(EntitySelectionField entitySelectionField) {
+
+// label = formFactory.createLabel(getLayoutComposite(), labelString, SWT.NULL);
+//
+// addControl(label);
+
+ selectableComposite = entitySelectionField;
+
+ int columns = 2;
+ if (isEditable) {
+ columns += 1;
+ }
+ if (isDeletable) {
+ columns += 1;
+ }
+
+ selectableComposite.setLayout(LayoutConstants.LAYOUT(columns, false));
+ selectableComposite.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
+
+ addControl(selectableComposite);
+
+ text = entitySelectionField.getText();
+ addControl(text);
+
+ text.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
+ text.setBackground(AbstractUtility.getColor(Resources.COLOR_TEXT_DISABLED_BACKGROUND));
+
+ button_selection = entitySelectionField.getButton_selection();
+ button_selection.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
+ button_selection.setToolTipText("Browse existing");
+
+ addControl(button_selection);
+ button_selection.addSelectionListener(this);
+
+ button_edit = entitySelectionField.getButton_edit();
+ if (isEditable) {
+ addControl(button_edit);
+ button_edit.addSelectionListener(new EditListener(this));
+ }
+ else{
+ button_edit.setVisible(false);
+ }
+
+ button_remove = entitySelectionField.getButton_remove();
+ if (isDeletable) {
+ addControl(button_remove);
+ button_remove.addSelectionListener(new DeleteListener(this));
+ }
+ else{
+ button_remove.setVisible(false);
+ }
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ T selection = SelectionDialogFactory.getSelectionFromDialog(clazz, getShell(), getConversationHolder(), getEntity());
+ setSelectionInternal(selection);
+ }
+
+ /**
+ * Return the selected object
+ *
+ * @return a T object.
+ */
+ public T getSelection() {
+ return entity;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.forms.IEnableableFormElement#setEnabled(boolean)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void setEnabled(boolean enabled) {
+ button_selection.setEnabled(enabled);
+ if (isEditable) {
+ button_edit.setEnabled(enabled && entity != null);
+ }
+ }
+
+ /**
+ * <p>
+ * setSelectionInternal
+ * </p>
+ *
+ * @param selection
+ * a T object.
+ */
+ protected void setSelectionInternal(T selection) {
+ if (selection != null && !selection.equals(this.entity)) {
+ setEntity(selection);
+ firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
+ }
+ }
+
+ /**
+ * <p>
+ * Setter for the field <code>entity</code>.
+ * </p>
+ *
+ * @param selection
+ * a T object.
+ */
+ public void setEntity(T selection) {
+ this.entity = selection;
+ updateElement();
+ }
+
+ /**
+ * Updates this elements view
+ */
+ protected void updateElement() {
+ String title = CdmUtils.Nz(getTitle());
+ // we have to duplicate ampersands otherwise they are treated as
+ // mnenomic (see Label.setText() documentation)
+ title = title.replace("&", "&&");
+ text.setText(title); // title can be null
+ if (isEditable) {
+ button_edit.setEnabled(entity != null);
+ }
+ }
+
+ @Override
+ public void updateFromWizard() {
+ updateElement();
+ firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
+ }
+
+ /**
+ * <p>
+ * getTitle
+ * </p>
+ *
+ * @return a {@link java.lang.String} object.
+ */
+ protected String getTitle() {
+ if (entity != null) {
+ if (entity instanceof IIdentifiableEntity) {
+ return ((IIdentifiableEntity) entity).getTitleCache();
+ } else if (entity instanceof Group) {
+ return ((Group) entity).getName();
+ } else if (entity instanceof GrantedAuthority) {
+ return ((GrantedAuthority) entity).getAuthority();
+ }
+ }
+ return "";
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setSelected(boolean selected) {
+ setBackground(selected ? SELECTED : getPersistentBackground());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see eu.etaxonomy.taxeditor.forms.IEntityElement#getEntity()
+ */
+ /**
+ * <p>
+ * Getter for the field <code>entity</code>.
+ * </p>
+ *
+ * @return a T object.
+ */
+ @Override
+ public T getEntity() {
+ return entity;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see eu.etaxonomy.taxeditor.forms.section.cdmdetail.ISelectableElement#
+ * getSelectionArbitrator()
+ */
+ /**
+ * <p>
+ * Getter for the field <code>selectionArbitrator</code>.
+ * </p>
+ *
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
+ * object.
+ */
+ @Override
+ public SelectionArbitrator getSelectionArbitrator() {
+ return selectionArbitrator;
+ }
+
+ @Override
+ public Shell getShell() {
+ return getLayoutComposite().getShell();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setIrrelevant(boolean irrelevant) {
+ String colorId = irrelevant ? Resources.COLOR_COMPOSITE_IRRELEVANT : Resources.COLOR_TEXT_DISABLED_BACKGROUND;
+
+ Color color = AbstractUtility.getColor(colorId);
+ text.setBackground(color);
+ }
+
+ private class DeleteListener extends SelectionAdapter {
+
+ private final EntitySelectionFieldController<T> selectionElement;
+
+ public DeleteListener(EntitySelectionFieldController<T> selectionElement) {
+ this.selectionElement = selectionElement;
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setEntity(null);
+ firePropertyChangeEvent(new CdmPropertyChangeEvent(selectionElement, null));
+ }
+ }
+
+ private class EditListener extends SelectionAdapter {
+
+ private final IEntitySelectionElement<T> selectionElement;
+
+ public EditListener(IEntitySelectionElement<T> selectionElement) {
+ this.selectionElement = selectionElement;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ WizardDialog dialog = new WizardDialog(selectionElement.getShell(), new EditFromSelectionWizard(selectionElement));
+ if (dialog.open() == IStatus.OK) {
+ selectionElement.updateFromWizard();
+ }
+ }
+ }
+
+ // not used
+ /** {@inheritDoc} */
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ /**
+ * <p>
+ * getConversationHolder
+ * </p>
+ *
+ * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
+ * object.
+ */
+ @Override
+ public ConversationHolder getConversationHolder() {
+ return conversation;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setBackground(Color color) {
+// label.setBackground(color);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setLabel(String labelString) {
+// if (label != null) {
+// label.setText(labelString);
+// }
+ }
+
+ /**
+ * <p>
+ * Getter for the field <code>label</code>.
+ * </p>
+ *
+ * @return a {@link java.lang.String} object.
+ */
+ @Override
+ public String getLabel() {
+// if (label != null) {
+// return label.getText();
+// }
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void update(CdmDataChangeMap changeEvents) {
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.basicFields;
+
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.widgets.Text;
+
+import eu.etaxonomy.cdm.model.common.LanguageString;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+
+/**
+ * @author pplitzner
+ * @date 15.08.2013
+ *
+ */
+public class LanguageTextFieldController extends TextFieldController{
+
+ private LanguageString languageString;
+
+ /**
+ * <p>Constructor for LanguageStringWithLabelElement.</p>
+ *
+ * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+ * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
+ * @param labelString a {@link java.lang.String} object.
+ * @param languageString a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
+ * @param style a int.
+ */
+ public LanguageTextFieldController(Text controlledText, CdmFormFactory formFactory,
+ ICdmFormElement parentElement,
+ LanguageString languageString) {
+ this(controlledText, formFactory, parentElement, languageString, null);
+ }
+
+ /**
+ * <p>Constructor for LanguageStringWithLabelElement.</p>
+ *
+ * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+ * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
+ * @param labelString a {@link java.lang.String} object.
+ * @param languageString a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
+ * @param height a int.
+ * @param style a int.
+ */
+ protected LanguageTextFieldController(Text controlledText, CdmFormFactory formFactory,
+ ICdmFormElement parentElement,
+ LanguageString languageString, Integer height) {
+ super(controlledText, formFactory, parentElement, null, height);
+
+ setLanguageString(languageString);
+ }
+
+ /**
+ * <p>Getter for the field <code>languageString</code>.</p>
+ *
+ * @return a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
+ */
+ public LanguageString getLanguageString() {
+ return languageString;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void modifyText(ModifyEvent e) {
+ if(languageString == null){
+ languageString = LanguageString.NewInstance("", CdmStore.getDefaultLanguage());
+ }
+
+ languageString.setText(text.getText());
+ super.modifyText(e);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setText(String text) {
+ if(text != null && languageString!=null){
+ languageString.setText(text);
+ super.setText(text);
+ }
+ }
+
+ /**
+ * <p>Setter for the field <code>languageString</code>.</p>
+ *
+ * @param languageString a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
+ */
+ public void setLanguageString(LanguageString languageString) {
+ this.languageString = languageString;
+ super.setText(languageString != null ? languageString.getText() : "");
+ }
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2013 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.campanula.basicFields;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionListener;
+
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
+
+/**
+ * @author pplitzner
+ * @date 15.08.2013
+ *
+ */
+public class NamedAreaFieldController extends AbstractEntityCollectionElement<NamedArea> {
+
+ private EntitySelectionFieldController<NamedArea> selection_namedArea;
+
+ /**
+ * <p>
+ * Constructor for CollectingAreasDetailElement.
+ * </p>
+ *
+ * @param formFactory
+ * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
+ * object.
+ * @param section
+ * a
+ * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
+ * object.
+ * @param entity
+ * a {@link eu.etaxonomy.cdm.model.location.NamedArea} object.
+ * @param removeListener
+ * a {@link org.eclipse.swt.events.SelectionListener} object.
+ * @param style
+ * a int.
+ */
+ public NamedAreaFieldController(CdmFormFactory formFactory, AbstractFormSection section, NamedArea entity, SelectionListener removeListener, int style) {
+ super(formFactory, section, entity, removeListener, null, style);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity
+ * (java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void setEntity(NamedArea entity) {
+ selection_namedArea.setEntity(entity);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls
+ * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void createControls(ICdmFormElement formElement, int style) {
+ selection_namedArea = new EntitySelectionFieldController<NamedArea>(new EntitySelectionField(formElement.getLayoutComposite(), SWT.NONE), getFormFactory(), getConversationHolder(), formElement, NamedArea.class, null, EntitySelectionElement.NOTHING);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent
+ * (java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void handleEvent(Object eventSource) {
+ if (eventSource == selection_namedArea) {
+ setEntity(selection_namedArea.getSelection());
+ }
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.basicFields;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Text;
+
+import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
+
+/**
+ * @author pplitzner
+ * @date 12.08.2013
+ *
+ */
+public class NumberFieldController extends TextFieldController {
+ private Float start;
+ private Float end;
+
+ private NumberFormatException exception;
+
+ /**
+ * <p>Constructor for NumberWithLabelElement.</p>
+ *
+ * @param toolkit a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+ * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
+ * @param labelString a {@link java.lang.String} object.
+ * @param initialNumber a {@link java.lang.Integer} object.
+ * @param style a int.
+ */
+ public NumberFieldController(Text controlledText, CdmFormFactory formFactory, ICdmFormElement parentElement, Number initialNumber){
+ super(controlledText, formFactory, parentElement, null, null);
+ //WindowBuilder exception handling
+ if(initialNumber==null){
+ initialNumber = 0;
+ }
+ setNumber(initialNumber);
+ }
+
+ /**
+ * <p>setInteger</p>
+ *
+ * @param number a {@link java.lang.Integer} object.
+ */
+ public void setInteger(Integer number) {
+ super.setText(getStringRepresentation(number));
+ }
+
+ /**
+ * <p>setNumber</p>
+ *
+ * @param number a {@link java.lang.Number} object.
+ */
+ public void setNumber(Number number) {
+ super.setText(getStringRepresentation(number));
+ }
+
+ /**
+ * <p>getInteger</p>
+ *
+ * @return a {@link java.lang.Integer} object.
+ */
+ public Integer getInteger() {
+ String text = super.getText().trim();
+ return text.equals("") ? 0 : new Integer(text);
+ }
+
+ /**
+ * <p>getFloat</p>
+ *
+ * @return a {@link java.lang.Float} object.
+ */
+ public Float getFloat(){
+ String text = super.getText();
+ return new Float(text);
+ }
+
+ /**
+ * <p>getDouble</p>
+ *
+ * @return a {@link java.lang.Float} object.
+ */
+ public Double getDouble(){
+ String text = super.getText();
+ return new Double(text);
+ }
+
+ private String getStringRepresentation(Object number){
+ if(number != null){
+ return number.toString();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void modifyText(ModifyEvent event) {
+ String value = text.getText();
+ if(CdmUtils.isEmpty(value)){
+ text.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ return;
+ }
+
+ try{
+
+ Float number = Float.parseFloat(value);
+
+ if((start != null && number < start) || (end != null && number > end)){
+ throw new NumberFormatException("You entered a number that is not within the allowed bounds.");
+ }
+
+ }catch(NumberFormatException e){
+ text.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
+ exception = e;
+ return;
+ }
+
+ exception = null;
+ text.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+
+ super.modifyText(event);
+ }
+
+ /**
+ * <p>setLimits</p>
+ *
+ * @param numberOfDigits a int.
+ * @param start a {@link java.lang.Integer} object.
+ * @param end a {@link java.lang.Integer} object.
+ */
+ public void setLimits(int numberOfDigits, Integer start, Integer end){
+ setLimits(numberOfDigits, start.floatValue(), end.floatValue());
+ }
+
+ /**
+ * <p>setLimits</p>
+ *
+ * @param numberOfDigits a int.
+ * @param start a {@link java.lang.Float} object.
+ * @param end a {@link java.lang.Float} object.
+ */
+ public void setLimits(int numberOfDigits, Float start, Float end){
+ text.setTextLimit(numberOfDigits);
+ this.start = start;
+ this.end = end;
+ }
+
+ /**
+ * <p>Getter for the field <code>exception</code>.</p>
+ *
+ * @return the exception
+ */
+ public NumberFormatException getException() {
+ return exception;
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.basicFields;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+/**
+ * @author pplitzner
+ * @date 15.08.2013
+ *
+ */
+public class PointField extends Composite {
+ private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+ private Text text_latitude;
+ private Text text_latitudeParsed;
+ private Text text_longitude;
+ private Text text_longitudeParsed;
+ private Text number_errorRadius;
+ private Combo combo_referenceSystem;
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public PointField(Composite parent, int style) {
+ super(parent, style);
+ {
+ setLayout(new TableWrapLayout());
+ }
+
+ text_latitude = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_latitude.setText("");
+ text_latitude.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ text_latitudeParsed = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_latitudeParsed.setEnabled(false);
+ text_latitudeParsed.setText("");
+ text_latitudeParsed.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ text_longitude = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_longitude.setText("");
+ text_longitude.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ text_longitudeParsed = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_longitudeParsed.setEnabled(false);
+ text_longitudeParsed.setText("");
+ text_longitudeParsed.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ number_errorRadius = formToolkit.createText(this, "New Text", SWT.NONE);
+ number_errorRadius.setText("");
+ number_errorRadius.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ combo_referenceSystem = new Combo(this, SWT.READ_ONLY);
+ combo_referenceSystem.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ formToolkit.adapt(combo_referenceSystem);
+ formToolkit.paintBordersFor(combo_referenceSystem);
+
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+
+ public Text getText_latitude() {
+ return text_latitude;
+ }
+ public Text getText_latitudeParsed() {
+ return text_latitudeParsed;
+ }
+ public Text getText_longitude() {
+ return text_longitude;
+ }
+ public Text getText_longitudeParsed() {
+ return text_longitudeParsed;
+ }
+ public Text getNumber_errorRadius() {
+ return number_errorRadius;
+ }
+ public Combo getCombo_referenceSystem() {
+ return combo_referenceSystem;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.widgets.Control#setEnabled(boolean)
+ */
+ @Override
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
+ text_latitude.setEnabled(enabled);
+ text_latitudeParsed.setEnabled(enabled);
+ text_longitude.setEnabled(enabled);
+ text_longitudeParsed.setEnabled(enabled);
+ number_errorRadius.setEnabled(enabled);
+ combo_referenceSystem.setEnabled(enabled);
+ }
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2013 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.campanula.basicFields;
+
+import java.text.ParseException;
+
+import org.eclipse.jface.util.PropertyChangeEvent;
+
+import eu.etaxonomy.cdm.model.location.Point;
+import eu.etaxonomy.cdm.model.location.ReferenceSystem;
+import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
+import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
+
+/**
+ * @author pplitzner
+ * @date 15.08.2013
+ *
+ */
+public class PointFieldController extends AbstractCdmFormElement implements IEntityElement<Point> {
+
+ private Point point;
+
+ private final TextFieldController text_latitude;
+ private final TextFieldController text_longitude;
+ private final NumberFieldController number_errorRadius;
+ private final ComboDefinedTermController<ReferenceSystem> combo_referenceSystem;
+
+ private final TextFieldController text_latitudeParsed;
+
+ private final TextFieldController text_longitudeParsed;
+
+ /**
+ * <p>
+ * Constructor for PointElement.
+ * </p>
+ *
+ * @param formFactory
+ * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
+ * object.
+ * @param formElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param point
+ * a {@link eu.etaxonomy.cdm.model.location.Point} object.
+ * @param style
+ * a int.
+ */
+ public PointFieldController(PointField pointField, CdmFormFactory formFactory, ICdmFormElement formElement, Point point, final int style) {
+ super(formFactory, formElement);
+
+ setPropertyChangeListeners(formFactory.getPropertyChangeListeners());
+ formFactory.addPropertyChangeListener(this);
+
+ text_latitude = new TextFieldController(pointField.getText_latitude(), getFormFactory(), formElement, null, style);
+ text_latitudeParsed = new TextFieldController(pointField.getText_latitudeParsed(), getFormFactory(), formElement, null, style);
+ text_longitude = new TextFieldController(pointField.getText_longitude(), getFormFactory(), formElement, null, style);
+ text_longitudeParsed = new TextFieldController(pointField.getText_longitudeParsed(), getFormFactory(), formElement, null, style);
+ number_errorRadius = new NumberFieldController(pointField.getNumber_errorRadius(), getFormFactory(), formElement, (Integer)null);
+ combo_referenceSystem = new ComboDefinedTermController<ReferenceSystem>(pointField.getCombo_referenceSystem(), getFormFactory(), formElement, ReferenceSystem.class, null, style);
+
+ setPoint(point);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#propertyChange(org
+ * .eclipse.jface.util.PropertyChangeEvent)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
+ if (event == null) {
+ return;
+ }
+
+ boolean propagate = false;
+
+ Object eventSource = event.getSource();
+ if (eventSource == text_latitude) {
+ try {
+ getPoint().setLatitudeByParsing(text_latitude.getText());
+ text_latitudeParsed.setText(point.getLatitudeSexagesimal().toString(false));
+ text_latitude.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+ propagate = true;
+ } catch (ParseException e) {
+ text_latitude.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
+ }
+ } else if (eventSource == text_longitude) {
+ try {
+ getPoint().setLongitudeByParsing(text_longitude.getText());
+ text_longitudeParsed.setText(point.getLongitudeSexagesimal().toString(false));
+ text_longitude.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+ propagate = true;
+ } catch (ParseException e) {
+ text_longitude.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
+ }
+ } else if (eventSource == number_errorRadius) {
+ getPoint().setErrorRadius(number_errorRadius.getInteger());
+ propagate = true;
+ } else if (eventSource == combo_referenceSystem) {
+ getPoint().setReferenceSystem(combo_referenceSystem.getSelection());
+ propagate = true;
+ }
+
+ if (propagate) {
+ firePropertyChangeEvent(new CdmPropertyChangeEvent(this, event));
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see eu.etaxonomy.taxeditor.forms.IEntityElement#getEntity()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public Point getEntity() {
+ return getPoint();
+ }
+
+ /**
+ * <p>
+ * setEntity
+ * </p>
+ *
+ * @param point
+ * a {@link eu.etaxonomy.cdm.model.location.Point} object.
+ */
+ public void setEntity(Point point) {
+ setPoint(point);
+ }
+
+ /**
+ * <p>
+ * Setter for the field <code>point</code>.
+ * </p>
+ *
+ * @param point
+ * the point to set
+ */
+ public void setPoint(Point point) {
+ this.point = point;
+ if (point != null) {
+ String latitude = point.getLatitudeSexagesimal() == null ? "" : point.getLatitudeSexagesimal().toString(false);
+ String longitude = point.getLongitudeSexagesimal() == null ? "" : point.getLongitudeSexagesimal().toString(false);
+ text_latitude.setText(latitude);
+ text_latitudeParsed.setText(latitude);
+ text_longitude.setText(longitude);
+ text_longitudeParsed.setText(longitude);
+ number_errorRadius.setInteger(point.getErrorRadius());
+ combo_referenceSystem.setSelection(point.getReferenceSystem());
+ }
+ }
+
+ /**
+ * <p>
+ * Getter for the field <code>point</code>.
+ * </p>
+ *
+ * @return the point
+ */
+ public Point getPoint() {
+ if (point == null) {
+ point = Point.NewInstance();
+ }
+
+ return point;
+ }
+
+ @Override
+ public void setSelected(boolean selected) {
+ setBackground(selected ? SELECTED : getPersistentBackground());
+ }
+}
\ No newline at end of file
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.basicFields;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wb.swt.SWTResourceManager;
+
+import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
+import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
+import eu.etaxonomy.taxeditor.ui.element.ISelectable;
+
+/**
+ * @author pplitzner
+ * @date 09.08.2013
+ *
+ */
+public class TextFieldController extends AbstractCdmFormElement implements ModifyListener, IEnableableFormElement, ISelectable{
+
+ protected Text text;
+
+ /** Constant <code>MAX_HEIGHT=0</code> */
+ public static final int MAX_HEIGHT = 0;
+ /** Constant <code>SINGLE=-1</code> */
+ public static final int SINGLE = -1;
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ * @param initialText
+ * @param textHeight
+ */
+ public TextFieldController(Text controlledText, CdmFormFactory formFactory, ICdmFormElement parentFormElement, String initialText, Integer textHeight) {
+ super(formFactory, parentFormElement);
+ setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
+
+ //vvvvvvvvvvvvv
+
+ setPropertyChangeListeners(formFactory.getPropertyChangeListeners());
+ formFactory.addPropertyChangeListener(this);
+
+ initialText = initialText==null?"":initialText;
+//
+// int scrollStyle = textHeight == null ? SWT.NULL : (SWT.V_SCROLL | SWT.MULTI);
+//
+// int combinedStyle = style | SWT.BORDER | scrollStyle;
+//
+// // SWT.PASSWORD does not work when SWT.WRAP is set.
+// if (style != SWT.PASSWORD) {
+// combinedStyle = combinedStyle | SWT.WRAP;
+// }
+ //^^^^^^^^^^^^^^
+
+ this.text = controlledText;
+// TableWrapData twd_text_1 = new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP);
+// twd_text_1.grabHorizontal = true;
+ setText(initialText);
+// text.setLayoutData(twd_text_1);
+
+
+ //vvvvvvvvvvvvvvvvvv
+ if (textHeight == null) {
+ text.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyPressed(KeyEvent e) {
+ if (e.character == SWT.CR) {
+ // Don't accept carriage returns as input when in single
+ // line mode
+ e.doit = false;
+ } else if (e.character == SWT.TAB) {
+ // traverse is not working for wrapped text widgets so
+ // we reintroduce it here
+ e.doit = false;
+ TextFieldController.this.text.traverse(SWT.TRAVERSE_TAB_NEXT);
+ }
+ }
+ });
+ }
+
+// if (textHeight != null && textHeight > 0) {
+// TableWrapData layoutData = LayoutConstants.FILL();
+// (layoutData).heightHint = textHeight;
+// text.setLayoutData(layoutData);
+// }
+
+ text.addModifyListener(this);
+
+ addControl(text);
+
+ }
+
+ /**
+ * Get the text of this composites text composite
+ *
+ * @return a {@link java.lang.String} object.
+ */
+ public String getText() {
+ return text.getText();
+ }
+
+ /**
+ * Set the text of this composites text composite
+ *
+ * @param string
+ * a {@link java.lang.String} object.
+ */
+ public void setText(String string) {
+ Listener[] listeners = text.getListeners(SWT.Modify);
+
+ for (Listener listener : listeners) {
+ text.removeListener(SWT.Modify, listener);
+ }
+
+ text.setText(CdmUtils.Nz(string));
+
+ for (Listener listener : listeners) {
+ text.addListener(SWT.Modify, listener);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events
+ * .ModifyEvent)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void modifyText(ModifyEvent e) {
+ firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setEnabled(boolean enabled) {
+ text.setEnabled(enabled);
+ String symbolicName = enabled ? Resources.COLOR_FONT_DEFAULT : Resources.COLOR_TEXT_DISABLED;
+ text.setForeground(getColor(symbolicName));
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setIrrelevant(boolean irrelevant) {
+ String colorId = irrelevant ? Resources.COLOR_COMPOSITE_IRRELEVANT : Resources.COLOR_COMPOSITE_BACKGROUND;
+
+ Color color = getColor(colorId);
+ text.setBackground(color);
+ }
+
+ @Override
+ public void setSelected(boolean selected) {
+ setBackground(selected ? SELECTED : getPersistentBackground());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#setFocus()
+ */
+ /** {@inheritDoc}
+ * @return */
+ @Override
+ public void setFocus() {
+ text.setFocus();
+ }
+
+ /**
+ * <p>
+ * getMainControl
+ * </p>
+ *
+ * @return a {@link org.eclipse.swt.widgets.Control} object.
+ */
+ public Control getMainControl() {
+ return text;
+ }
+
+ /**
+ * <p>
+ * setTextLimit
+ * </p>
+ *
+ * @param limit
+ * a int.
+ */
+ public void setTextLimit(int limit) {
+ text.setTextLimit(limit);
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.basicFields;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+/**
+ * @author pplitzner
+ * @date 14.08.2013
+ *
+ */
+public class ToggleableTextField extends Composite {
+ private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+ private Text text;
+ private Button editButton;
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public ToggleableTextField(Composite parent, int style) {
+ super(parent, style);
+ setBackgroundMode(SWT.INHERIT_DEFAULT);
+ {
+ TableWrapLayout tableWrapLayout = new TableWrapLayout();
+ tableWrapLayout.numColumns = 2;
+ tableWrapLayout.verticalSpacing = 0;
+ tableWrapLayout.topMargin = 0;
+ tableWrapLayout.rightMargin = 0;
+ tableWrapLayout.leftMargin = 0;
+ tableWrapLayout.horizontalSpacing = 0;
+ tableWrapLayout.bottomMargin = 0;
+ setLayout(tableWrapLayout);
+ }
+
+ text = formToolkit.createText(this, "New Text", SWT.WRAP);
+ text.setText("");
+ TableWrapData twd_text = new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1);
+ twd_text.grabVertical = true;
+ text.setLayoutData(twd_text);
+
+ editButton = formToolkit.createButton(this, "Edit", SWT.TOGGLE);
+
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+
+ public Text getText() {
+ return text;
+ }
+ public Button getEditButton() {
+ return editButton;
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.basicFields;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+
+import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
+import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
+import eu.etaxonomy.taxeditor.ui.element.ISelectable;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+
+/**
+ * @author pplitzner
+ * @date 14.08.2013
+ *
+ */
+public class ToggleableTextFieldController extends AbstractCdmFormElement implements SelectionListener, ModifyListener, IEnableableFormElement, ISelectable {
+
+ private ToggleableTextField toggleableTextField;
+
+ private boolean state;
+ private Set<SelectionListener> selectionListener = new HashSet<SelectionListener>();
+ //TODO also connect label
+// private Label label;
+
+ /**
+ * <p>Constructor for ToggleableTextElement.</p>
+ *
+ * @param style a int.
+ * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+ * @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 initialState a boolean.
+ */
+ public ToggleableTextFieldController(ToggleableTextField toggleableTextField, CdmFormFactory formFactory, ICdmFormElement parentElement,
+ String initialText, boolean initialState, int style) {
+ super(formFactory, parentElement);
+ setPropertyChangeListeners(formFactory.getPropertyChangeListeners());
+ formFactory.addPropertyChangeListener(this);
+
+ this.toggleableTextField = toggleableTextField;
+
+// label = formFactory.createLabel(getLayoutComposite(), labelString, style);
+// addControl(label);
+
+ Text text = toggleableTextField.getText();
+ addControl(text);
+ text.addModifyListener(this);
+ text.setLayoutData(LayoutConstants.FILL());
+
+ // Don't accept carriage returns as input
+ text.addKeyListener( new KeyAdapter(){
+ @Override
+ public void keyPressed(KeyEvent e) {
+ if(e.character == SWT.CR) {
+ e.doit = false;
+ }
+ }
+ });
+
+ Button editButton = toggleableTextField.getEditButton();
+ addControl(editButton);
+ editButton.addSelectionListener(this);
+
+ setState(initialState);
+ }
+
+ /**
+ * <p>setText</p>
+ *
+ * @param text a {@link java.lang.String} object.
+ */
+ public void setText(String text){
+ if(text != null){
+ // store current caret position
+ Text textField = toggleableTextField.getText();
+ int caretPosition = textField.getCaretPosition();
+
+ Listener[] listeners = textField.getListeners(SWT.Modify);
+ for (Listener listener : listeners) {
+ textField.removeListener(SWT.Modify, listener);
+ }
+ textField.setText(CdmUtils.Nz(text));
+ for (Listener listener : listeners) {
+ textField.addListener(SWT.Modify, listener);
+ }
+
+ // restore caret position
+ textField.setSelection(caretPosition);
+ }
+ }
+
+ /**
+ * <p>getText</p>
+ *
+ * @return a {@link java.lang.String} object.
+ */
+ public String getText(){
+ return toggleableTextField.getText().getText();
+ }
+
+ /**
+ * <p>Setter for the field <code>state</code>.</p>
+ *
+ * @param state a boolean.
+ */
+ public void setState(boolean state) {
+ this.state = state;
+ setEnabled(state);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setEnabled(boolean enabled) {
+ toggleableTextField.getText().setEnabled(enabled);
+ String symbolicName = enabled ? Resources.COLOR_FONT_DEFAULT : Resources.COLOR_TEXT_DISABLED;
+ toggleableTextField.getText().setForeground(StoreUtil.getColor(symbolicName));
+ toggleableTextField.getEditButton().setSelection(enabled);
+ }
+
+ /**
+ * <p>Getter for the field <code>state</code>.</p>
+ *
+ * @return a boolean.
+ */
+ public boolean getState(){
+ return state;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setState(toggleableTextField.getEditButton().getSelection());
+ for(SelectionListener listener : selectionListener){
+ listener.widgetSelected(e);
+ }
+ firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
+ }
+
+ /**
+ * <p>addSelectionListener</p>
+ *
+ * @param listener a {@link org.eclipse.swt.events.SelectionListener} object.
+ */
+ public void addSelectionListener(SelectionListener listener){
+ selectionListener.add(listener);
+ }
+
+ /**
+ * <p>removeSelectionListener</p>
+ *
+ * @param listener a {@link org.eclipse.swt.events.SelectionListener} object.
+ */
+ public void removeSelectionListener(SelectionListener listener){
+ selectionListener.remove(listener);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {}
+
+ /** {@inheritDoc} */
+ @Override
+ public void modifyText(ModifyEvent e) {
+ firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setIrrelevant(boolean irrelevant) {
+ String colorId = irrelevant ? Resources.COLOR_COMPOSITE_IRRELEVANT : Resources.COLOR_COMPOSITE_BACKGROUND;
+
+ Color color = getColor(colorId);
+ toggleableTextField.getText().setBackground(color);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setBackground(Color color) {
+// label.setBackground(color);
+ toggleableTextField.setBackground(color);
+ }
+
+ @Override
+ public void setSelected(boolean selected) {
+ setBackground(selected ? SELECTED : getPersistentBackground());
+ }
+}
-package eu.etaxonomy.taxeditor.ui.element;
+package eu.etaxonomy.taxeditor.ui.campanula.compatibility;
import java.util.List;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.IPropertyChangeEmitter;
+
/**
* <p>ICdmFormElement interface.</p>
*
*/
public abstract void setPropertyChangeListeners(
List<IPropertyChangeListener> propertyChangeListeners);
-
+
/**
* <p>getControls</p>
*
* @return a {@link java.util.Set} object.
*/
public abstract Set<Control> getControls();
-
+
/**
* <p>getElements</p>
*
* @return a {@link java.util.Set} object.
*/
public abstract Set<ICdmFormElement> getElements();
-
+
/**
* <p>addElement</p>
*
* @param element a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
*/
public abstract void addElement(ICdmFormElement element);
-
+
/**
* <p>getParentElement</p>
*
* @return a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
*/
public abstract ICdmFormElement getParentElement();
-
+
/**
* <p>removeElements</p>
*/
public abstract void removeElements();
-
+
/**
* <p>getLayoutComposite</p>
*
* @return a {@link org.eclipse.swt.widgets.Composite} object.
*/
public abstract Composite getLayoutComposite();
-
+
/**
* <p>containsFormElement</p>
*
* @return a boolean.
*/
public boolean containsFormElement(ICdmFormElement formElement);
-
+
/**
* <p>setBackground</p>
*
* @param color a {@link org.eclipse.swt.graphics.Color} object.
*/
public void setBackground(Color color);
-
+
/**
* Sets a background color for this element and stores this background color
* for future reference
- *
+ *
* @param color
*/
public void setPersistentBackground(Color color);
-
+
/**
* Get the background color that is associated with this element.
- *
+ *
* @return
*/
public Color getPersistentBackground();
-
+
/**
* Refreshes the layout of this form element.
*
* changes and the current element needs to display that changes
*/
public void refresh();
+
+ /**
+ * <p>Getter for the field <code>formFactory</code>.</p>
+ *
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+ */
+ public CdmFormFactory getFormFactory();
}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.compatibility;
+
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.model.common.ICdmBase;
+import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
+import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
+import eu.etaxonomy.taxeditor.ui.element.ILabeledElement;
+import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
+
+/**
+ * @author pplitzner
+ * @date 15.08.2013
+ *
+ */
+public interface IEntitySelectionElement<T extends ICdmBase> extends SelectionListener, IEnableableFormElement, ISelectableElement, IEntityElement<T>, ILabeledElement, IConversationEnabled {
+ /**
+ * Convenient access to current shell
+ *
+ * @return a {@link org.eclipse.swt.widgets.Shell} object.
+ */
+ public abstract Shell getShell();
+
+ /**
+ * <p>
+ * updateFromWizard
+ * </p>
+ */
+ public abstract void updateFromWizard();
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.fieldObservation;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+import org.eclipse.wb.swt.SWTResourceManager;
+
+/**
+ * @author pplitzner
+ * @date 15.08.2013
+ *
+ */
+public class FieldObservationDetailsElement extends Composite {
+ private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+ private Text text_ecology;
+ private Text text_plantDescription;
+ private Text text_FieldNotes;
+ private Text text_IndividualCount;
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public FieldObservationDetailsElement(Composite parent, int style) {
+ super(parent, style);
+ setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
+ {
+ TableWrapLayout tableWrapLayout = new TableWrapLayout();
+ tableWrapLayout.numColumns = 2;
+ tableWrapLayout.verticalSpacing = 0;
+ tableWrapLayout.topMargin = 0;
+ tableWrapLayout.rightMargin = 0;
+ tableWrapLayout.leftMargin = 0;
+ tableWrapLayout.horizontalSpacing = 0;
+ tableWrapLayout.bottomMargin = 0;
+ setLayout(tableWrapLayout);
+ }
+
+ Label lblEcology = formToolkit.createLabel(this, "Ecology", SWT.NONE);
+
+ text_ecology = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_ecology.setText("");
+ text_ecology.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblPlantDescription = formToolkit.createLabel(this, "Plant Description", SWT.NONE);
+
+ text_plantDescription = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_plantDescription.setText("");
+ text_plantDescription.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblFieldNotes = formToolkit.createLabel(this, "Field Notes", SWT.NONE);
+
+ text_FieldNotes = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_FieldNotes.setText("");
+ text_FieldNotes.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblIndividualCount = formToolkit.createLabel(this, "Individual Count", SWT.NONE);
+
+ text_IndividualCount = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_IndividualCount.setText("");
+ text_IndividualCount.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+
+ public Text getText_ecology() {
+ return text_ecology;
+ }
+ public Text getText_plantDescription() {
+ return text_plantDescription;
+ }
+ public Text getText_FieldNotes() {
+ return text_FieldNotes;
+ }
+ public Text getText_IndividualCount() {
+ return text_IndividualCount;
+ }
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2013 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.campanula.detailViews.fieldObservation;
+
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.NumberFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.TextFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+
+/**
+ * @author pplitzner
+ * @date 15.08.2013
+ *
+ */
+public class FieldObservationDetailsElementController extends AbstractCdmDetailElement<DerivedUnitFacade> {
+
+ private FieldObservationDetailsElement fieldObservationDetailsElement;
+
+ private TextFieldController text_ecology;
+
+ private TextFieldController text_plantDescription;
+
+ private TextFieldController text_fieldObjectDefinition;
+
+ private TextFieldController text_fieldNotes;
+
+ private NumberFieldController number_individualCount;
+
+ /**
+ * <p>
+ * Constructor for FieldObservationDetailElement.
+ * </p>
+ *
+ * @param formFactory
+ * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
+ * object.
+ * @param formElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ */
+ public FieldObservationDetailsElementController(FieldObservationDetailsElement fieldObservationDetailsElement, CdmFormFactory formFactory, ICdmFormElement formElement) {
+ super(formFactory, formElement);
+ this.fieldObservationDetailsElement = fieldObservationDetailsElement;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+// text_ecology = new TextFieldController(fieldObservationDetailsElement.getText_ecology(), getFormFactory(), formElement, entity.getEcology(CdmStore.getDefaultLanguage()), null);
+// text_plantDescription = new TextFieldController(fieldObservationDetailsElement.getText_plantDescription(), getFormFactory(), formElement, entity.getPlantDescription(CdmStore.getDefaultLanguage()), style);
+ // Disable for now
+ // text_fieldObjectDefinition = formFactory.createTextWithLabelElement(formElement, "Field Object Definition", entity.getFieldObjectDefinition(CdmStore.getDefaultLanguage()), style);
+ text_fieldNotes = new TextFieldController(fieldObservationDetailsElement.getText_FieldNotes(), getFormFactory(), formElement, entity.getFieldNotes(), style);
+
+ number_individualCount = new NumberFieldController(fieldObservationDetailsElement.getText_IndividualCount(), getFormFactory(), formElement, entity.getIndividualCount());
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void handleEvent(Object eventSource) {
+// if (eventSource == text_ecology) {
+// getEntity().setEcology(text_ecology.getText());
+// } else if (eventSource == text_plantDescription) {
+// getEntity().setPlantDescription(text_plantDescription.getText());
+// } else if (eventSource == text_fieldObjectDefinition) {
+// getEntity().addFieldObjectDefinition(text_fieldObjectDefinition.getText(), CdmStore.getDefaultLanguage());
+// } else
+ if (eventSource == text_fieldNotes) {
+ getEntity().setFieldNotes(text_fieldNotes.getText());
+ } else if (eventSource == number_individualCount) {
+ getEntity().setIndividualCount(number_individualCount.getInteger());
+ }
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.fieldObservation;
+
+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.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+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 21.08.2013
+ *
+ */
+public class FieldObservationDetailsSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
+
+ /**
+ * <p>Constructor for FieldObservationDetailSection.</p>
+ *
+ * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+ * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
+ * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
+ * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
+ * @param style a int.
+ */
+ public FieldObservationDetailsSection(CdmFormFactory formFactory, ConversationHolder conversation,
+ ICdmFormElement parentElement,
+ ISelectionProvider selectionProvider, int style) {
+ super(formFactory, conversation, parentElement, selectionProvider, style);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public String getHeading() {
+ return "Field Observation Details";
+ }
+
+ /* (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.createFieldObservationDetailsElementController(parentElement);
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.fieldObservation;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+import org.eclipse.wb.swt.SWTResourceManager;
+
+/**
+ * @author pplitzner
+ * @date 07.08.2013
+ *
+ */
+public class FieldObservationDetailsView extends Composite {
+ private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public FieldObservationDetailsView(Composite parent, int style) {
+ super(parent, style);
+ setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
+ {
+ TableWrapLayout tableWrapLayout = new TableWrapLayout();
+ tableWrapLayout.numColumns = 1;
+ setLayout(tableWrapLayout);
+ }
+
+ ExpandableComposite xpndblcmpstNewExpandablecomposite = formToolkit.createExpandableComposite(this, ExpandableComposite.TWISTIE);
+ TableWrapData twd_xpndblcmpstNewExpandablecomposite = new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP, 1, 1);
+ twd_xpndblcmpstNewExpandablecomposite.grabHorizontal = true;
+ xpndblcmpstNewExpandablecomposite.setLayoutData(twd_xpndblcmpstNewExpandablecomposite);
+ formToolkit.paintBordersFor(xpndblcmpstNewExpandablecomposite);
+ xpndblcmpstNewExpandablecomposite.setText("FieldObservation");
+ xpndblcmpstNewExpandablecomposite.setExpanded(true);
+
+ FieldObservationGeneralElement fieldObservationGeneralElement = new FieldObservationGeneralElement(xpndblcmpstNewExpandablecomposite, SWT.NONE);
+ formToolkit.adapt(fieldObservationGeneralElement);
+ formToolkit.paintBordersFor(fieldObservationGeneralElement);
+ xpndblcmpstNewExpandablecomposite.setClient(fieldObservationGeneralElement);
+
+ ExpandableComposite xpndblcmpstNewExpandablecomposite_1 = formToolkit.createExpandableComposite(this, ExpandableComposite.TWISTIE);
+ TableWrapData twd_xpndblcmpstNewExpandablecomposite_1 = new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP, 1, 1);
+ twd_xpndblcmpstNewExpandablecomposite_1.grabHorizontal = true;
+ xpndblcmpstNewExpandablecomposite_1.setLayoutData(twd_xpndblcmpstNewExpandablecomposite_1);
+ formToolkit.paintBordersFor(xpndblcmpstNewExpandablecomposite_1);
+ xpndblcmpstNewExpandablecomposite_1.setText("Gathering Event Details");
+ xpndblcmpstNewExpandablecomposite_1.setExpanded(true);
+
+ GatheringEventDetailsElement gatheringEventDetailsElement = new GatheringEventDetailsElement(xpndblcmpstNewExpandablecomposite_1, SWT.NONE);
+ formToolkit.adapt(gatheringEventDetailsElement);
+ formToolkit.paintBordersFor(gatheringEventDetailsElement);
+ xpndblcmpstNewExpandablecomposite_1.setClient(gatheringEventDetailsElement);
+
+ ExpandableComposite xpndblcmpstFieldObservationDetails = formToolkit.createExpandableComposite(this, ExpandableComposite.TWISTIE);
+ TableWrapData twd_xpndblcmpstFieldObservationDetails = new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP, 1, 1);
+ twd_xpndblcmpstFieldObservationDetails.grabHorizontal = true;
+ xpndblcmpstFieldObservationDetails.setLayoutData(twd_xpndblcmpstFieldObservationDetails);
+ formToolkit.paintBordersFor(xpndblcmpstFieldObservationDetails);
+ xpndblcmpstFieldObservationDetails.setText("Field Observation Details");
+ xpndblcmpstFieldObservationDetails.setExpanded(true);
+
+ FieldObservationDetailsElement fieldObservationDetailsElement = new FieldObservationDetailsElement(xpndblcmpstFieldObservationDetails, SWT.NONE);
+ formToolkit.adapt(fieldObservationDetailsElement);
+ formToolkit.paintBordersFor(fieldObservationDetailsElement);
+ xpndblcmpstFieldObservationDetails.setClient(fieldObservationDetailsElement);
+
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2013 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.campanula.detailViews.fieldObservation;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.EntitySelectionField;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.PointField;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.ToggleableTextField;
+
+/**
+ * @author pplitzner
+ * @date 07.08.2013
+ *
+ */
+public class FieldObservationGeneralElement extends Composite {
+ private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+ private final Text textLocality;
+ private final Text textElevation;
+ private final Text textCollectingNumber;
+ private EntitySelectionField countrySelectionField;
+ private EntitySelectionField collectorSelectionField;
+ private ToggleableTextField toggleableTextField;
+ private PointField pointField;
+ private Text textAccessionNumber;
+ private EntitySelectionField collectionSelectionField;
+ private Label lblCollection;
+ private Label lblAccesionNumber;
+ private Label lblCountry;
+ private Label lblLocality;
+ private Label lblLatitude;
+ private Label lblLongitude;
+ private Label lblErrorRadiusm;
+ private Label lblReferenceSystem;
+ private Label lblAbsoluteElevationm;
+ private Label lblDate;
+ private Label lblCollector;
+ private Label lblCollectingNumber;
+
+ /**
+ * Create the composite.
+ *
+ * @param parent
+ * @param style
+ */
+ public FieldObservationGeneralElement(Composite parent, int style) {
+ super(parent, SWT.NONE);
+ setBackgroundMode(SWT.INHERIT_DEFAULT);
+ {
+ TableWrapLayout tableWrapLayout = new TableWrapLayout();
+ tableWrapLayout.numColumns = 2;
+ setLayout(tableWrapLayout);
+ }
+
+ Label lblTitleCache = formToolkit.createLabel(this, "Title Cache", SWT.NONE);
+
+ toggleableTextField = new ToggleableTextField(this, SWT.NONE);
+ toggleableTextField.setBackgroundMode(SWT.INHERIT_DEFAULT);
+ TableWrapData twd_toggleableTextField = new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP, 1, 1);
+ twd_toggleableTextField.grabHorizontal = true;
+ toggleableTextField.setLayoutData(twd_toggleableTextField);
+ formToolkit.adapt(toggleableTextField);
+ formToolkit.paintBordersFor(toggleableTextField);
+
+ lblCountry = new Label(this, SWT.NONE);
+ formToolkit.adapt(lblCountry, true, true);
+ lblCountry.setText("Country");
+
+ countrySelectionField = new EntitySelectionField(this, SWT.NONE);
+ countrySelectionField.setBackgroundMode(SWT.INHERIT_DEFAULT);
+ countrySelectionField.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ formToolkit.adapt(countrySelectionField);
+ formToolkit.paintBordersFor(countrySelectionField);
+
+ lblLocality = formToolkit.createLabel(this, "Locality", SWT.NONE);
+
+ textLocality = formToolkit.createText(this, "New Text", SWT.NONE);
+ textLocality.setText("");
+ textLocality.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ lblLatitude = formToolkit.createLabel(this, "Latitude", SWT.NONE);
+
+ pointField = new PointField(this, SWT.NONE);
+ TableWrapLayout twl_pointField = (TableWrapLayout) pointField.getLayout();
+ twl_pointField.verticalSpacing = 0;
+ twl_pointField.topMargin = 0;
+ twl_pointField.rightMargin = 0;
+ twl_pointField.leftMargin = 0;
+ twl_pointField.horizontalSpacing = 0;
+ twl_pointField.bottomMargin = 0;
+ pointField.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP, 6, 1));
+ formToolkit.adapt(pointField);
+ formToolkit.paintBordersFor(pointField);
+ new Label(this, SWT.NONE);
+
+ lblLongitude = formToolkit.createLabel(this, "Longitude", SWT.NONE);
+ new Label(this, SWT.NONE);
+
+ lblErrorRadiusm = formToolkit.createLabel(this, "Error Radius (m)", SWT.NONE);
+
+ lblReferenceSystem = formToolkit.createLabel(this, "Reference System", SWT.NONE);
+
+ lblAbsoluteElevationm = formToolkit.createLabel(this, "Absolute Elevation (m)", SWT.NONE);
+
+ textElevation = formToolkit.createText(this, "New Text", SWT.NONE);
+ textElevation.setText("");
+ textElevation.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ lblDate = formToolkit.createLabel(this, "Date", SWT.NONE);
+ new Label(this, SWT.NONE);
+
+ lblCollector = formToolkit.createLabel(this, "Collector", SWT.NONE);
+
+ collectorSelectionField = new EntitySelectionField(this, SWT.NONE);
+ collectorSelectionField.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ formToolkit.adapt(collectorSelectionField);
+ formToolkit.paintBordersFor(collectorSelectionField);
+
+ lblCollectingNumber = formToolkit.createLabel(this, "Collecting Number", SWT.NONE);
+
+ textCollectingNumber = formToolkit.createText(this, "New Text", SWT.NONE);
+ textCollectingNumber.setText("");
+ textCollectingNumber.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ lblCollection = formToolkit.createLabel(this, "Collection", SWT.NONE);
+
+ collectionSelectionField = new EntitySelectionField(this, SWT.NONE);
+ formToolkit.adapt(collectionSelectionField);
+ formToolkit.paintBordersFor(collectionSelectionField);
+
+ lblAccesionNumber = formToolkit.createLabel(this, "Accesion Number", SWT.NONE);
+
+ textAccessionNumber = formToolkit.createText(this, "New Text", SWT.NONE);
+ textAccessionNumber.setText("");
+ textAccessionNumber.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+
+ public EntitySelectionField getCountrySelectionField() {
+ return countrySelectionField;
+ }
+
+ public EntitySelectionField getCollectorSelectionField() {
+ return collectorSelectionField;
+ }
+
+ public Text getTextElevation() {
+ return textElevation;
+ }
+
+ public Text getTextLocality() {
+ return textLocality;
+ }
+
+ public Text getTextCollectingNumber() {
+ return textCollectingNumber;
+ }
+
+ public ToggleableTextField getToggleableTextField() {
+ return toggleableTextField;
+ }
+
+ public PointField getPointField() {
+ return pointField;
+ }
+ public EntitySelectionField getCollectionSelectionField() {
+ return collectionSelectionField;
+ }
+ public Text getTextAccessionNumber() {
+ return textAccessionNumber;
+ }
+ public Label getLblCollection() {
+ return lblCollection;
+ }
+ public Label getLblAccesionNumber() {
+ return lblAccesionNumber;
+ }
+ public Label getLblCountry() {
+ return lblCountry;
+ }
+ public Label getLblLocality() {
+ return lblLocality;
+ }
+ public Label getLblLatitude() {
+ return lblLatitude;
+ }
+ public Label getLblLongitude() {
+ return lblLongitude;
+ }
+ public Label getLblErrorRadiusm() {
+ return lblErrorRadiusm;
+ }
+ public Label getLblReferenceSystem() {
+ return lblReferenceSystem;
+ }
+ public Label getLblAbsoluteElevation() {
+ return lblAbsoluteElevationm;
+ }
+ public Label getLblDate() {
+ return lblDate;
+ }
+ public Label getLblCollector() {
+ return lblCollector;
+ }
+ public Label getLblCollectingNumber() {
+ return lblCollectingNumber;
+ }
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2013 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.campanula.detailViews.fieldObservation;
+
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.model.agent.AgentBase;
+import eu.etaxonomy.cdm.model.common.LanguageString;
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.occurrence.Collection;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.EntitySelectionFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.LanguageTextFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.NumberFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.PointFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.TextFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.ToggleableTextFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
+
+/**
+ * @author pplitzner
+ * @date 13.08.2013
+ *
+ */
+public class FieldObservationGeneralElementController extends AbstractCdmDetailElement<DerivedUnitFacade> {
+
+ private FieldObservationGeneralElement fieldObservationGeneralElement;
+
+ private ToggleableTextFieldController toggleableText_titleCache;
+ private EntitySelectionFieldController<NamedArea> selection_country;
+ private LanguageTextFieldController languageText_locality;
+ private PointFieldController element_point;
+ private NumberFieldController number_elevation;
+ private TimePeriodElement element_date;//TODO convert
+ private EntitySelectionFieldController<AgentBase> selection_collector;
+ private TextFieldController text_collectingNumber;
+ private EntitySelectionFieldController<Collection> selectionCollection;
+ private TextFieldController textAccessionNumber;
+
+ boolean isSpecimen;
+ boolean isWizard;
+
+ /**
+ * @param formFactory
+ * @param formElement
+ */
+ public FieldObservationGeneralElementController(FieldObservationGeneralElement fieldObservationGeneralElement, CdmFormFactory formFactory, ICdmFormElement formElement, boolean isSpecimen, boolean isWizard) {
+ super(formFactory, formElement);
+ this.fieldObservationGeneralElement = fieldObservationGeneralElement;
+ this.isSpecimen = isSpecimen;
+ this.isWizard = isWizard;
+ setPropertyChangeListeners(formFactory.getPropertyChangeListeners());
+ formFactory.addPropertyChangeListener(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
+ * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
+ */
+ @Override
+ protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+ toggleableText_titleCache = new ToggleableTextFieldController(fieldObservationGeneralElement.getToggleableTextField(), getFormFactory(), formElement, entity.getTitleCache(), entity.isProtectedTitleCache(), style);
+
+ selection_country = new EntitySelectionFieldController<NamedArea>(fieldObservationGeneralElement.getCountrySelectionField(), getFormFactory(), getConversationHolder(), formElement, NamedArea.class, entity.getCountry(), EntitySelectionElement.NOTHING);
+ languageText_locality = new LanguageTextFieldController(fieldObservationGeneralElement.getTextLocality(), getFormFactory(), formElement, entity.getLocality());
+ element_point = new PointFieldController(fieldObservationGeneralElement.getPointField(),getFormFactory(), formElement, entity.getExactLocation(), style);
+ number_elevation = new NumberFieldController(fieldObservationGeneralElement.getTextElevation(), getFormFactory(), formElement, entity.getAbsoluteElevation());
+ element_date = formFactory.createTimePeriodElement(formElement, "Date", entity.getGatheringPeriod(), style);
+ selection_collector = new EntitySelectionFieldController<AgentBase>(fieldObservationGeneralElement.getCollectorSelectionField(), getFormFactory(), getConversationHolder(), formElement, AgentBase.class, entity.getCollector(), EntitySelectionElement.ALL);
+ text_collectingNumber = new TextFieldController(fieldObservationGeneralElement.getTextCollectingNumber(), getFormFactory(), formElement, entity.getFieldNumber(), null);
+ if(isWizard){
+ if(!isSpecimen){
+ fieldObservationGeneralElement.getLblCollection().setVisible(false);
+ fieldObservationGeneralElement.getCollectionSelectionField().setVisible(false);
+ fieldObservationGeneralElement.getLblAccesionNumber().setVisible(false);
+ fieldObservationGeneralElement.getTextAccessionNumber().setVisible(false);
+ }
+ else{
+ selectionCollection = new EntitySelectionFieldController<Collection>(fieldObservationGeneralElement.getCollectionSelectionField(), getFormFactory(), getConversationHolder(), formElement, Collection.class, entity.getCollection(), EntitySelectionElement.ALL);
+ textAccessionNumber = new TextFieldController(fieldObservationGeneralElement.getTextAccessionNumber(), getFormFactory(), formElement, entity.getAccessionNumber(), null);
+ }
+ }
+ else{
+ if(isSpecimen){
+ selectionCollection = new EntitySelectionFieldController<Collection>(fieldObservationGeneralElement.getCollectionSelectionField(), getFormFactory(), getConversationHolder(), formElement, Collection.class, entity.getCollection(), EntitySelectionElement.ALL);
+ textAccessionNumber = new TextFieldController(fieldObservationGeneralElement.getTextAccessionNumber(), getFormFactory(), formElement, entity.getAccessionNumber(), null);
+ fieldObservationGeneralElement.getLblCountry().setEnabled(false);
+ fieldObservationGeneralElement.getCountrySelectionField().setEnabled(false);
+ fieldObservationGeneralElement.getLblLocality().setEnabled(false);
+ fieldObservationGeneralElement.getTextLocality().setEnabled(false);
+
+ fieldObservationGeneralElement.getPointField().setEnabled(false);
+ // fieldObservationGeneralElement.getPointField().getText_latitude().setEnabled(false);
+ fieldObservationGeneralElement.getLblLatitude().setEnabled(false);
+ // fieldObservationGeneralElement.getPointField().getText_longitude().setEnabled(false);
+ fieldObservationGeneralElement.getLblLongitude().setEnabled(false);
+ // fieldObservationGeneralElement.getPointField().getNumber_errorRadius().setEnabled(false);
+ fieldObservationGeneralElement.getLblErrorRadiusm().setEnabled(false);
+ // fieldObservationGeneralElement.getPointField().getCombo_referenceSystem().setEnabled(false);
+ fieldObservationGeneralElement.getLblReferenceSystem().setEnabled(false);
+
+ fieldObservationGeneralElement.getLblAbsoluteElevation().setEnabled(false);
+ fieldObservationGeneralElement.getTextElevation().setEnabled(false);
+ fieldObservationGeneralElement.getLblDate().setEnabled(false);
+
+ fieldObservationGeneralElement.getLblCollector().setEnabled(false);
+ fieldObservationGeneralElement.getCollectorSelectionField().setEnabled(false);
+ fieldObservationGeneralElement.getLblCollectingNumber().setEnabled(false);
+ fieldObservationGeneralElement.getTextCollectingNumber().setEnabled(false);
+ }
+ else{
+ fieldObservationGeneralElement.getLblCollection().setVisible(false);
+ fieldObservationGeneralElement.getCollectionSelectionField().setVisible(false);
+ fieldObservationGeneralElement.getLblAccesionNumber().setVisible(false);
+ fieldObservationGeneralElement.getTextAccessionNumber().setVisible(false);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
+ * .lang.Object)
+ */
+ @Override
+ public void handleEvent(Object eventSource) {
+ if (eventSource == toggleableText_titleCache) {
+ getEntity().setTitleCache(toggleableText_titleCache.getText(), toggleableText_titleCache.getState());
+ } else if (eventSource == selection_country) {
+ getEntity().setCountry(selection_country.getSelection());
+ } else if (eventSource == languageText_locality) {
+ LanguageString locality = languageText_locality.getLanguageString();
+ getEntity().setLocality(locality);
+ } else if (eventSource == element_point) {
+ getEntity().setExactLocation(element_point.getPoint());
+ } else if (eventSource == number_elevation) {
+ getEntity().setAbsoluteElevation(number_elevation.getInteger());
+ } else if (eventSource == element_date) {
+ getEntity().setGatheringPeriod(element_date.getTimePeriod());
+ } else if (eventSource == selection_collector) {
+ getEntity().setCollector(selection_collector.getSelection());
+ } else if (eventSource == text_collectingNumber) {
+ getEntity().setFieldNumber(text_collectingNumber.getText());
+ } else if (eventSource == selectionCollection) {
+ getEntity().setCollection(selectionCollection.getSelection());
+ } else if (eventSource == textAccessionNumber) {
+ getEntity().setAccessionNumber(textAccessionNumber.getText());
+ }
+ if (eventSource != toggleableText_titleCache) {
+ toggleableText_titleCache.setText(getEntity().getTitleCache());
+ }
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.fieldObservation;
+
+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.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+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 16.08.2013
+ *
+ */
+public class FieldObservationGeneralSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
+
+ /**
+ * <p>Constructor for FieldObservationDetailSection.</p>
+ *
+ * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+ * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
+ * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
+ * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
+ * @param style a int.
+ */
+ public FieldObservationGeneralSection(CdmFormFactory formFactory, ConversationHolder conversation,
+ ICdmFormElement parentElement,
+ ISelectionProvider selectionProvider, int style) {
+ super(formFactory, conversation, parentElement, selectionProvider, style);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public String getHeading() {
+ return "Field Observation";
+ }
+
+ /* (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.createFieldObservationGeneralElementController(parentElement);
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.fieldObservation;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+import org.eclipse.wb.swt.SWTResourceManager;
+
+/**
+ * @author pplitzner
+ * @date 07.08.2013
+ *
+ */
+public class GatheringEventDetailsElement extends Composite {
+ private FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+ private Text textElevationError;
+ private Text text_ElevationMinimum;
+ private Text text_ElevationMaximum;
+ private Text text_CollectingMethod;
+ private Text text_DistanceToGround;
+ private Text text_DistanceToWaterSurface;
+ private Text text_GatheringEventDescription;
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public GatheringEventDetailsElement(Composite parent, int style) {
+ super(parent, style);
+ setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
+ {
+ TableWrapLayout tableWrapLayout = new TableWrapLayout();
+ tableWrapLayout.verticalSpacing = 0;
+ tableWrapLayout.topMargin = 0;
+ tableWrapLayout.rightMargin = 0;
+ tableWrapLayout.leftMargin = 0;
+ tableWrapLayout.horizontalSpacing = 0;
+ tableWrapLayout.bottomMargin = 0;
+ tableWrapLayout.numColumns = 2;
+ setLayout(tableWrapLayout);
+ }
+
+ Label lblElevationError = formToolkit.createLabel(this, "Elevation Error", SWT.NONE);
+
+ textElevationError = formToolkit.createText(this, "New Text", SWT.NONE);
+ textElevationError.setText("");
+ textElevationError.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblElevationMinimumm = formToolkit.createLabel(this, "Elevation Minimum (m)", SWT.NONE);
+
+ text_ElevationMinimum = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_ElevationMinimum.setText("");
+ text_ElevationMinimum.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblElevationMaximumm = formToolkit.createLabel(this, "Elevation Maximum (m)", SWT.NONE);
+
+ text_ElevationMaximum = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_ElevationMaximum.setText("");
+ text_ElevationMaximum.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblCollectingMethod = formToolkit.createLabel(this, "Collecting Method", SWT.NONE);
+
+ text_CollectingMethod = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_CollectingMethod.setText("");
+ text_CollectingMethod.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblDistanceToGround = formToolkit.createLabel(this, "Distance To Ground (m)", SWT.NONE);
+
+ text_DistanceToGround = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_DistanceToGround.setText("");
+ text_DistanceToGround.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblDistanceToWater = formToolkit.createLabel(this, "Distance To Water Surface (m)", SWT.NONE);
+
+ text_DistanceToWaterSurface = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_DistanceToWaterSurface.setText("");
+ text_DistanceToWaterSurface.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblGatheringEventDescription = formToolkit.createLabel(this, "Gathering Event Description", SWT.NONE);
+
+ text_GatheringEventDescription = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_GatheringEventDescription.setText("");
+ text_GatheringEventDescription.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+
+ public Text getTextElevationError() {
+ return textElevationError;
+ }
+ public Text getText_ElevationMinimum() {
+ return text_ElevationMinimum;
+ }
+ public Text getText_ElevationMaximum() {
+ return text_ElevationMaximum;
+ }
+ public Text getText_CollectingMethod() {
+ return text_CollectingMethod;
+ }
+ public Text getText_DistanceToGround() {
+ return text_DistanceToGround;
+ }
+ public Text getText_DistanceToWaterSurface() {
+ return text_DistanceToWaterSurface;
+ }
+ public Text getText_GatheringEventDescription() {
+ return text_GatheringEventDescription;
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.fieldObservation;
+
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.NumberFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.TextFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.CollectingAreasDetailSection;
+
+/**
+ * @author pplitzner
+ * @date 14.08.2013
+ *
+ */
+public class GatheringEventDetailsElementController extends AbstractCdmDetailElement<DerivedUnitFacade> {
+
+ private GatheringEventDetailsElement gatheringEventDetailsElement;
+
+// private NumberFieldController number_absoluteElevationError;
+
+// private NumberFieldController number_absoluteElevationMinimum;
+
+ private NumberFieldController number_absoluteElevationMaximum;
+
+ private TextFieldController text_collectingMethod;
+
+ private NumberFieldController number_distanceToGround;
+
+ private NumberFieldController number_distanceToWaterSurface;
+
+ private TextFieldController text_gatheringEventDescription;
+
+ private CollectingAreasDetailSection section_collectingAreas;
+
+ /**
+ * <p>
+ * Constructor for GatheringEventDetailElement.
+ * </p>
+ *
+ * @param formFactory
+ * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
+ * object.
+ * @param formElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ */
+ public GatheringEventDetailsElementController(GatheringEventDetailsElement gatheringEventDetailsElement, CdmFormFactory formFactory, ICdmFormElement formElement) {
+ super(formFactory, formElement);
+ this.gatheringEventDetailsElement = gatheringEventDetailsElement;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+
+// number_absoluteElevationError = new NumberFieldController(gatheringEventDetailsElement.getTextElevationError(), formFactory, this, entity.getAbsoluteElevation());
+// number_absoluteElevationMinimum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMinimum(), formFactory, this, entity.getAbsoluteElevationMinimum());
+ number_absoluteElevationMaximum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMaximum(), formFactory, this, entity.getAbsoluteElevationMaximum());
+ text_collectingMethod = new TextFieldController(gatheringEventDetailsElement.getText_CollectingMethod(), formFactory, this, entity.getCollectingMethod(), null);
+ number_distanceToGround = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToGround(), formFactory, this, entity.getDistanceToGround());
+ number_distanceToWaterSurface = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToWaterSurface(), formFactory, this, entity.getDistanceToWaterSurface());
+ text_gatheringEventDescription = new TextFieldController(gatheringEventDetailsElement.getText_GatheringEventDescription(), formFactory, this, entity.getGatheringEventDescription(), null);
+ section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+ section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ section_collectingAreas.setEntity(entity);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void handleEvent(Object eventSource) {
+// if (eventSource == number_absoluteElevationError) {
+// getEntity().setAbsoluteElevationError(number_absoluteElevationError.getDouble());
+// }
+// else if (eventSource == number_absoluteElevationMinimum) {
+// try {
+// getEntity().setAbsoluteElevationRange(number_absoluteElevationMinimum.getInteger(), number_absoluteElevationMaximum.getInteger());
+// number_absoluteElevationMinimum.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+// } catch (IllegalArgumentException e) {
+// number_absoluteElevationMinimum.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
+// AbstractUtility.warn(getClass(), e.getLocalizedMessage());
+// }
+// }
+// else if (eventSource == number_absoluteElevationMaximum) {
+// try {
+// getEntity().setAbsoluteElevationRange(number_absoluteElevationError.getInteger(), number_absoluteElevationMaximum.getInteger());
+// number_absoluteElevationMaximum.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+// } catch (IllegalArgumentException e) {
+// number_absoluteElevationMaximum.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
+// AbstractUtility.warn(getClass(), e.getLocalizedMessage());
+// }
+// } else
+ if (eventSource == text_collectingMethod) {
+ getEntity().setCollectingMethod(text_collectingMethod.getText());
+ } else if (eventSource == number_distanceToGround) {
+ getEntity().setDistanceToGround(number_distanceToGround.getDouble());
+ } else if (eventSource == number_distanceToWaterSurface) {
+ getEntity().setDistanceToWaterSurface(number_distanceToWaterSurface.getDouble());
+ } else if (eventSource == text_gatheringEventDescription) {
+ getEntity().setGatheringEventDescription(text_gatheringEventDescription.getText());
+ }
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.fieldObservation;
+
+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.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+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 21.08.2013
+ *
+ */
+public class GatheringEventSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
+
+ /**
+ * <p>Constructor for GatheringEventDetailSection.</p>
+ *
+ * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+ * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
+ * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
+ * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
+ * @param style a int.
+ */
+ public GatheringEventSection(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 "Gathering Event Details";
+ }
+
+ /* (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.createGatheringEventDetailsElementController(parentElement);
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.specimen;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+import org.eclipse.wb.swt.SWTResourceManager;
+
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.EntitySelectionField;
+
+/**
+ * @author pplitzner
+ * @date 29.08.2013
+ *
+ */
+public class DerivedUnitDetailsElement extends Composite {
+ private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+ private Text textBarcode;
+ private Text textCatalogNumber;
+ private Text txtExsiccatum;
+ private Combo comboPreservationMethod;
+ private EntitySelectionField storedUnderSelectionField;
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public DerivedUnitDetailsElement(Composite parent, int style) {
+ super(parent, style);
+ setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
+ {
+ TableWrapLayout tableWrapLayout = new TableWrapLayout();
+ tableWrapLayout.numColumns = 2;
+ setLayout(tableWrapLayout);
+ }
+
+ Label lblBarcode = formToolkit.createLabel(this, "Barcode", SWT.NONE);
+
+ textBarcode = formToolkit.createText(this, "New Text", SWT.NONE);
+ textBarcode.setText("");
+ textBarcode.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblCatalognumber = formToolkit.createLabel(this, "CatalogNumber", SWT.NONE);
+
+ textCatalogNumber = formToolkit.createText(this, "New Text", SWT.NONE);
+ textCatalogNumber.setText("");
+ textCatalogNumber.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblPreservationMethod = formToolkit.createLabel(this, "Preservation Method", SWT.NONE);
+
+ comboPreservationMethod = new Combo(this, SWT.NONE);
+ comboPreservationMethod.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ formToolkit.adapt(comboPreservationMethod);
+ formToolkit.paintBordersFor(comboPreservationMethod);
+
+ Label lblStoredUnder = formToolkit.createLabel(this, "Stored Under", SWT.NONE);
+
+ storedUnderSelectionField = new EntitySelectionField(this, SWT.NONE);
+ formToolkit.adapt(storedUnderSelectionField);
+ formToolkit.paintBordersFor(storedUnderSelectionField);
+
+ Label lblExsiccatum = formToolkit.createLabel(this, "Exsiccatum", SWT.NONE);
+
+ txtExsiccatum = formToolkit.createText(this, "New Text", SWT.NONE);
+ txtExsiccatum.setText("");
+ txtExsiccatum.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+
+ public Text getTextBarcode() {
+ return textBarcode;
+ }
+ public Text getTextCatalogNumber() {
+ return textCatalogNumber;
+ }
+ public Combo getComboPreservationMethod() {
+ return comboPreservationMethod;
+ }
+ public EntitySelectionField getStoredUnderSelectionField() {
+ return storedUnderSelectionField;
+ }
+ public Text getTxtExsiccatum() {
+ return txtExsiccatum;
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.specimen;
+
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.api.facade.MethodNotSupportedByDerivedUnitTypeException;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.EntitySelectionFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.TextFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SourceCollectionDetailSection;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
+
+/**
+ * @author pplitzner
+ * @date 29.08.2013
+ *
+ */
+public class DerivedUnitDetailsElementController extends AbstractCdmDetailElement<DerivedUnitFacade> {
+
+ private DerivedUnitDetailsElement derivedUnitDetailsElement;
+
+ private TextFieldController barCode;
+ private TextFieldController catalogNumber;
+// private ComboDefinedTermController<PreservationMethod> preservationMethod;
+ private EntitySelectionFieldController<TaxonNameBase> storedUnder;
+ private TextFieldController exsiccatum;
+
+ private SourceCollectionDetailSection section_source;
+
+
+ public DerivedUnitDetailsElementController(DerivedUnitDetailsElement derivedUnitDetailsElement, CdmFormFactory formFactory, ICdmFormElement formElement) {
+ super(formFactory, formElement);
+ this.derivedUnitDetailsElement = derivedUnitDetailsElement;
+ setPropertyChangeListeners(formFactory.getPropertyChangeListeners());
+ formFactory.addPropertyChangeListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement, java.lang.Object, int)
+ */
+ @Override
+ protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+ barCode = new TextFieldController(derivedUnitDetailsElement.getTextBarcode(), getFormFactory(), formElement, entity.getBarcode(), null);
+ catalogNumber = new TextFieldController(derivedUnitDetailsElement.getTextCatalogNumber(), getFormFactory(), formElement, entity.getCatalogNumber(), null);
+ PreservationMethod entityPreservationMethod;
+ try {
+ entityPreservationMethod = entity.getPreservationMethod();
+ } catch (MethodNotSupportedByDerivedUnitTypeException e) {
+ // we ignore this
+ AbstractUtility.info(e.getMessage());
+ entityPreservationMethod = null;
+ }
+// preservationMethod = new ComboDefinedTermController<PreservationMethod>(derivedUnitDetailsElement.getComboPreservationMethod(), getFormFactory(), formElement, PreservationMethod.class, entityPreservationMethod, style);
+ storedUnder = new EntitySelectionFieldController<TaxonNameBase>(derivedUnitDetailsElement.getStoredUnderSelectionField(), getFormFactory(), getConversationHolder(), formElement, TaxonNameBase.class, entity.getStoredUnder(), EntitySelectionElement.ALL);
+ String entitiyExsiccatum;
+ try {
+ entitiyExsiccatum = entity.getExsiccatum();
+ } catch (MethodNotSupportedByDerivedUnitTypeException e) {
+ // we ignore this
+ AbstractUtility.info(e.getMessage());
+ entitiyExsiccatum = null;
+ }
+ exsiccatum = new TextFieldController(derivedUnitDetailsElement.getTxtExsiccatum(), getFormFactory(), formElement, entitiyExsiccatum, null);
+
+ section_source = formFactory.createSourceCollectionDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+ section_source.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ section_source.setEntity(entity);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
+ */
+ @Override
+ public void handleEvent(Object eventSource) {
+ if (eventSource == barCode) {
+ getEntity().setBarcode(barCode.getText());
+ } else if (eventSource == catalogNumber) {
+ getEntity().setCatalogNumber(catalogNumber.getText());
+// } else if (eventSource == preservationMethod) {
+// try {
+// getEntity().setPreservationMethod(preservationMethod.getSelection());
+// } catch (MethodNotSupportedByDerivedUnitTypeException e) {
+// AbstractUtility.errorDialog("MethodNotSupportedByDerivedUnitTypeException", this, "MethodNotSupportedByDerivedUnitTypeException when trying to set preservation method for derive unit", e);
+// }
+ } else if (eventSource == storedUnder) {
+ getEntity().setStoredUnder(storedUnder.getEntity());
+ } else if (eventSource == exsiccatum) {
+ try {
+ getEntity().setExsiccatum(exsiccatum.getText());
+ } catch (Exception e) {
+ AbstractUtility.error(this.getClass(), e);
+ }
+ }
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.specimen;
+
+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.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+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 29.08.2013
+ *
+ */
+public class DerivedUnitDetailsSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection {
+
+ public DerivedUnitDetailsSection(CdmFormFactory formFactory, ConversationHolder conversation,
+ ICdmFormElement parentElement,
+ ISelectionProvider selectionProvider, int style) {
+ super(formFactory, conversation, parentElement, selectionProvider, style);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public String getHeading() {
+ return "Derived Unit Details";
+ }
+
+ /* (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.createDerivedUnitDetailsElementController(parentElement);
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.specimen;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+import org.eclipse.wb.swt.SWTResourceManager;
+
+/**
+ * @author pplitzner
+ * @date 29.08.2013
+ *
+ */
+public class SpecimenDetailsElement extends Composite {
+ private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+ private Text text_IndividualEcology;
+ private Text text_PlantDesriptionDetails;
+ private Text text_IndividualFieldNotes;
+ private Combo comboLiveStage;
+ private Combo combo_Sex;
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public SpecimenDetailsElement(Composite parent, int style) {
+ super(parent, style);
+ setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
+ {
+ TableWrapLayout tableWrapLayout = new TableWrapLayout();
+ tableWrapLayout.numColumns = 2;
+ setLayout(tableWrapLayout);
+ }
+
+ Label lblNewLabel = formToolkit.createLabel(this, "Individual Ecology", SWT.NONE);
+
+ text_IndividualEcology = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_IndividualEcology.setText("");
+ text_IndividualEcology.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblPlantDescriptionDetails = formToolkit.createLabel(this, "Plant Description Details", SWT.NONE);
+
+ text_PlantDesriptionDetails = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_PlantDesriptionDetails.setText("");
+ text_PlantDesriptionDetails.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblIndividualFieldNotes = formToolkit.createLabel(this, "Individual Field Notes", SWT.NONE);
+
+ text_IndividualFieldNotes = formToolkit.createText(this, "New Text", SWT.NONE);
+ text_IndividualFieldNotes.setText("");
+ text_IndividualFieldNotes.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblLiveStage = formToolkit.createLabel(this, "Live Stage", SWT.NONE);
+
+ comboLiveStage = new Combo(this, SWT.NONE);
+ comboLiveStage.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ formToolkit.adapt(comboLiveStage);
+ formToolkit.paintBordersFor(comboLiveStage);
+
+ Label lblSex = formToolkit.createLabel(this, "Sex", SWT.NONE);
+
+ combo_Sex = new Combo(this, SWT.NONE);
+ combo_Sex.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ formToolkit.adapt(combo_Sex);
+ formToolkit.paintBordersFor(combo_Sex);
+
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+
+ public Text getText_IndividualEcology() {
+ return text_IndividualEcology;
+ }
+ public Text getText_PlantDesriptionDetails() {
+ return text_PlantDesriptionDetails;
+ }
+ public Text getText_IndividualFieldNotes() {
+ return text_IndividualFieldNotes;
+ }
+ public Combo getComboLiveStage() {
+ return comboLiveStage;
+ }
+ public Combo getCombo_Sex() {
+ return combo_Sex;
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.specimen;
+
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.ComboDefinedTermController;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.TextFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+
+/**
+ * @author pplitzner
+ * @date 29.08.2013
+ *
+ */
+public class SpecimenDetailsElementController extends AbstractCdmDetailElement<DerivedUnitFacade> {
+
+ private SpecimenDetailsElement specimenDetailsElement;
+ private TextFieldController individualEcology;
+ private TextFieldController plantDescriptionDetails;
+ private TextFieldController individualFieldNotes;
+ private ComboDefinedTermController<DefinedTerm> liveStage;
+ private ComboDefinedTermController<DefinedTerm> sex;
+
+
+ public SpecimenDetailsElementController(SpecimenDetailsElement specimenDetailsElement, CdmFormFactory formFactory, ICdmFormElement formElement) {
+ super(formFactory, formElement);
+ this.specimenDetailsElement = specimenDetailsElement;
+ setPropertyChangeListeners(formFactory.getPropertyChangeListeners());
+ formFactory.addPropertyChangeListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement, java.lang.Object, int)
+ */
+ @Override
+ protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+ individualEcology = new TextFieldController(specimenDetailsElement.getText_IndividualEcology(), getFormFactory(), formElement, entity.getEcology(), null);
+ plantDescriptionDetails = new TextFieldController(specimenDetailsElement.getText_PlantDesriptionDetails(), getFormFactory(), formElement, entity.getPlantDescription(), null);
+ plantDescriptionDetails = new TextFieldController(specimenDetailsElement.getText_IndividualFieldNotes(), getFormFactory(), formElement, entity.getFieldNotes(), null);
+ liveStage = new ComboDefinedTermController<DefinedTerm>(specimenDetailsElement.getComboLiveStage(), getFormFactory(), formElement, DefinedTerm.class, entity.getLifeStage(), style);
+ sex = new ComboDefinedTermController<DefinedTerm>(specimenDetailsElement.getCombo_Sex(), getFormFactory(), formElement, DefinedTerm.class, entity.getSex(), style);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
+ */
+ @Override
+ public void handleEvent(Object eventSource) {
+ if(eventSource == individualEcology){
+ getEntity().setEcology(individualEcology.getText());
+ }
+ else if(eventSource == plantDescriptionDetails){
+ getEntity().setPlantDescription(plantDescriptionDetails.getText());
+ }
+ else if(eventSource == individualFieldNotes){
+ getEntity().setFieldNotes(individualFieldNotes.getText());
+ }
+ else if(eventSource == liveStage){
+ getEntity().setLifeStage(liveStage.getSelection());
+ }
+ else if(eventSource == sex){
+ getEntity().setSex(sex.getSelection());
+ }
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.specimen;
+
+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.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+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 29.08.2013
+ *
+ */
+public class SpecimenDetailsSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection {
+
+ public SpecimenDetailsSection(CdmFormFactory formFactory, ConversationHolder conversation,
+ ICdmFormElement parentElement,
+ ISelectionProvider selectionProvider, int style) {
+ super(formFactory, conversation, parentElement, selectionProvider, style);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public String getHeading() {
+ return "Specimen Details";
+ }
+
+ /* (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.createSpecimenDetailsElementController(parentElement);
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.detailViews.specimen;
+
+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.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+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 16.08.2013
+ *
+ */
+public class SpecimenGeneralSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
+
+ public SpecimenGeneralSection(CdmFormFactory formFactory, ConversationHolder conversation,
+ ICdmFormElement parentElement,
+ ISelectionProvider selectionProvider, int style) {
+ super(formFactory, conversation, parentElement, selectionProvider, style);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public String getHeading() {
+ return "Specimen";
+ }
+
+ /* (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.createSpecimenGeneralElementController(parentElement);
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.specimenSearch;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+/**
+ * @author pplitzner
+ * @date 03.09.2013
+ *
+ */
+public class SpecimenSearchComposite extends Composite {
+ private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+ private Text textTaxonName;
+ private Text textCollector;
+ private Text textCollectorNumber;
+ private Text textAccessionNumber;
+ private Text textLocality;
+ private Text textHerbarium;
+ private Text textCountry;
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public SpecimenSearchComposite(Composite parent, int style) {
+ super(parent, style);
+ setBackgroundMode(SWT.INHERIT_DEFAULT);
+ {
+ TableWrapLayout tableWrapLayout = new TableWrapLayout();
+ tableWrapLayout.numColumns = 2;
+ setLayout(tableWrapLayout);
+ }
+
+ Label lblTaxonName = formToolkit.createLabel(this, "Taxon Name", SWT.NONE);
+
+ textTaxonName = new Text(this, SWT.BORDER);
+ textTaxonName.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ formToolkit.adapt(textTaxonName, true, true);
+
+ Label lblCollectors = new Label(this, SWT.NONE);
+ formToolkit.adapt(lblCollectors, true, true);
+ lblCollectors.setText("Collector(s)");
+
+ textCollector = new Text(this, SWT.BORDER);
+ textCollector.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ formToolkit.adapt(textCollector, true, true);
+
+ Label lblCollectorsNumber = new Label(this, SWT.NONE);
+ formToolkit.adapt(lblCollectorsNumber, true, true);
+ lblCollectorsNumber.setText("Collector(s) Number");
+
+ textCollectorNumber = new Text(this, SWT.BORDER);
+ textCollectorNumber.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ formToolkit.adapt(textCollectorNumber, true, true);
+
+ Label lblAccessionNumber = new Label(this, SWT.NONE);
+ formToolkit.adapt(lblAccessionNumber, true, true);
+ lblAccessionNumber.setText("Accession Number");
+
+ textAccessionNumber = new Text(this, SWT.BORDER);
+ textAccessionNumber.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ formToolkit.adapt(textAccessionNumber, true, true);
+
+ Label lblHerbarium = new Label(this, SWT.NONE);
+ formToolkit.adapt(lblHerbarium, true, true);
+ lblHerbarium.setText("Herbarium");
+
+ textHerbarium = new Text(this, SWT.NONE);
+ textHerbarium.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblCountry = new Label(this, SWT.NONE);
+ formToolkit.adapt(lblCountry, true, true);
+ lblCountry.setText("Country");
+
+ textCountry = new Text(this, SWT.NONE);
+ textCountry.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+
+ Label lblLocality = new Label(this, SWT.NONE);
+ formToolkit.adapt(lblLocality, true, true);
+ lblLocality.setText("Locality");
+
+ textLocality = new Text(this, SWT.BORDER);
+ textLocality.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ formToolkit.adapt(textLocality, true, true);
+
+ Label lblCollectionDate = new Label(this, SWT.NONE);
+ formToolkit.adapt(lblCollectionDate, true, true);
+ lblCollectionDate.setText("Collection Date");
+ new Label(this, SWT.NONE);
+
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+
+ public Text getTextTaxonName() {
+ return textTaxonName;
+ }
+ public Text getTextCollector() {
+ return textCollector;
+ }
+ public Text getTextCollectorNumber() {
+ return textCollectorNumber;
+ }
+ public Text getTextAccessionNumber() {
+ return textAccessionNumber;
+ }
+ public Text getTextHerbarium() {
+ return textHerbarium;
+ }
+ public Text getTextCountry() {
+ return textCountry;
+ }
+ public Text getTextLocality() {
+ return textLocality;
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.campanula.specimenSearch;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Controller class for handling a {@link SpecimenSearchComposite}.
+ * @author pplitzner
+ * @date 03.09.2013
+ *
+ */
+public class SpecimenSearchController {
+
+ private final SpecimenSearchComposite specimenSearchComposite;
+
+ /**
+ * @param specimenSearchComposite
+ */
+ public SpecimenSearchController(Composite parent) {
+ this.specimenSearchComposite = new SpecimenSearchComposite(parent, SWT.NONE);
+ }
+
+ /**
+ * Returns the {@link Composite} handled by this controller
+ * @return
+ */
+ public Composite getComposite() {
+ return specimenSearchComposite;
+ }
+
+ /**
+ * Returns the taxon name entered in the search view
+ * @return the taxon name as a {@link String}
+ * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextTaxonName()
+ */
+ public String getTaxonName() {
+ return specimenSearchComposite.getTextTaxonName().getText();
+ }
+
+ /**
+ * Returns the collector entered in the search view
+ * @return the collector as a {@link String}
+ * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextCollector()
+ */
+ public String getCollector() {
+ return specimenSearchComposite.getTextCollector().getText();
+ }
+
+ /**
+ * Returns the collecting number entered in the search view
+ * @return the collecting as a {@link String}
+ * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextCollectorNumber()
+ */
+ public String getCollectorNumber() {
+ return specimenSearchComposite.getTextCollectorNumber().getText();
+ }
+
+ /**
+ * Returns the accession number entered in the search view
+ * @return the accession number as a {@link String}
+ * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextAccessionNumber()
+ */
+ public String getAccessionNumber() {
+ return specimenSearchComposite.getTextAccessionNumber().getText();
+ }
+
+ /**
+ * Returns the herbarium entered in the search view
+ * @return the herbarium as a {@link String}
+ * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getComboHerbarium()
+ */
+ public String getHerbarium() {
+ return specimenSearchComposite.getTextHerbarium().getText();
+// return specimenSearchComposite.getComboHerbarium().getItem(specimenSearchComposite.getComboHerbarium().getSelectionIndex());
+ }
+
+ /**
+ * Returns the country entered in the search view
+ * @return the country as a {@link String}
+ * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getComboCountry()
+ */
+ public String getCountry() {
+ return specimenSearchComposite.getTextCountry().getText();
+// return specimenSearchComposite.getComboCountry().getItem(specimenSearchComposite.getComboCountry().getSelectionIndex());
+ }
+
+ /**
+ * Returns the locality entered in the search view
+ * @return the locality as a {@link String}
+ * @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextLocality()
+ */
+ public String getLocality() {
+ return specimenSearchComposite.getTextLocality().getText();
+ }
+
+}
\ No newline at end of file
import eu.etaxonomy.cdm.model.reference.ReferenceType;
import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
import eu.etaxonomy.taxeditor.ui.element.ISelectable;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.store.TermManager;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
import eu.etaxonomy.taxeditor.ui.element.ISelectable;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
protected List<UuidAndTitleCache<T>> model;
private final Set<T> transientCdmObjects = new HashSet<T>();
private final String settings;
-
+
protected T cdmBaseToBeFiltered;
-
+
/**
* <p>Constructor for AbstractFilteredCdmResourceSelectionDialog.</p>
*
* @param shell a {@link org.eclipse.swt.widgets.Shell} object.
- * @param conversation
+ * @param conversation
* @param title a {@link java.lang.String} object.
* @param multi a boolean.
* @param settings a {@link java.lang.String} object.
setTitle(title);
setMessage("Use * for wildcard, or ? to see all entries");
this.settings = settings;
-
+
this.conversation = conversation;
-
+
init();
-
+
initModel();
-
+
String objectTitle = getTitle(cdmObject);
if (objectTitle != null) {
setInitialPattern(objectTitle);
}
-
+
setListLabelProvider(createListLabelProvider());
setDetailsLabelProvider(createDetailsLabelProvider());
-
+
setSelectionHistory(new ResourceSelectionHistory());
}
-
+
/**
* By default, we are returning the standard list label provider
- *
- * Override in subclasses if you want different behavior
- *
+ *
+ * Override in subclasses if you want different behavior
+ *
* @return
*/
protected ILabelProvider createDetailsLabelProvider() {
}
/**
- *
+ *
* @return
*/
protected ILabelProvider createListLabelProvider() {
* Will run before initModel()
*/
protected void init() {
-
+
}
-
+
/**
* <p>getSelectionFromDialog</p>
*
protected static <TYPE extends CdmBase> TYPE getSelectionFromDialog(AbstractFilteredCdmResourceSelectionDialog<TYPE> dialog) {
//dialog.setInitialPattern("");
int result = dialog.open();
-
+
if (result == Window.CANCEL) {
return null;
}
-
+
UUID uuid = dialog.getSelectedUuidAndTitleCache().getUuid();
if(uuid == null){
return null;
- }
+ }
return dialog.getCdmObjectByUuid(uuid);
}
-
+
/**
* Check if object was created during the life of this dialog. If not,
* retrieve it from the CdmStore.
}
return getPersistentObject(cdmUuid);
}
-
+
/**
* <p>getPersistentObject</p>
*
if(cdmObject == null){
return "";
}
-
+
if (cdmObject instanceof IIdentifiableEntity) {
- return ((IIdentifiableEntity) cdmObject).getTitleCache();
+ return ((IIdentifiableEntity) cdmObject).getTitleCache();
}
-
+
throw new IllegalArgumentException("Generic method only" +
" supports cdmObject of type IIdentifiableEntity." +
" Please implement specific method in subclass.");
}
-
+
/** {@inheritDoc} */
@Override
filterExcludedObjects();
super.refresh();
}
-
+
/**
* <p>initModel</p>
*/
public boolean equalsFilter(ItemsFilter filter) {
return false;
}
-
+
@Override
public boolean isConsistentItem(Object item) {
return false;
}
return text != null ? matches(text) : false;
}
-
+
};
}
-
+
/**
* Set the filter input to the Agent's title cache
* @param cdmObject a T object.
*/
protected void setPattern(T cdmObject) {
- // FilteredSelection does some very tricky caching to make sure it
- // runs with high performance.
+ // FilteredSelection does some very tricky caching to make sure it
+ // runs with high performance.
// This works for most use cases, but we want to change the model while the dialog is open
// and all the clever caching prevents the content provider from knowing that the model has changed
- // I am aware, that this is a hack, but the FilteredSelectionDialog API does not offer a convenient
+ // I am aware, that this is a hack, but the FilteredSelectionDialog API does not offer a convenient
// way to solve the problem.
try {
Field lastCompletedFilter = this.getClass().getSuperclass().getSuperclass().getDeclaredField("lastCompletedFilter");
} catch (IllegalAccessException e) {
AbstractUtility.error(getClass(), e);
}
-
- // this also is not the nicest way to do it.
+
+ // this also is not the nicest way to do it.
// I am still amazed, that FilteredSelectionDialog does not offer any methods to change its data
// once it was opened. Am I doing it wrong?
String pattern = getTitle(cdmObject);
((Text) getPatternControl()).setText(pattern);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#fillContentProvider(org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter, org.eclipse.core.runtime.IProgressMonitor)
*/
ItemsFilter itemsFilter, IProgressMonitor progressMonitor)
throws CoreException {
try {
- if(model != null){
+ if(model != null){
progressMonitor.beginTask("Looking for entities", model.size());
for(UuidAndTitleCache<T> element : model){
contentProvider.add(element, itemsFilter);
protected Comparator getItemsComparator() {
return new Comparator<UuidAndTitleCache>() {
@Override
- public int compare(UuidAndTitleCache entity1,
+ public int compare(UuidAndTitleCache entity1,
UuidAndTitleCache entity2) {
Collator collator = Collator.getInstance();
return collator.compare(entity1.getTitleCache(), entity2.getTitleCache());
protected IStatus validateItem(Object item) {
return Status.OK_STATUS;
}
-
+
/**
* <p>getSelectedUuidAndTitleCache</p>
*
Object[] result = getResult();
return result[0] == null ? null : (UuidAndTitleCache) result[0];
}
-
+
/**
* <p>Getter for the field <code>settings</code>.</p>
*
}
return settings;
}
-
+
/**
- *
+ *
* @author n.hoffmann
* @created Oct 19, 2009
* @version 1.0
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.SelectionHistory#restoreItemFromMemento(org.eclipse.ui.IMemento)
*/
@Override
- protected Object restoreItemFromMemento(IMemento element) {
+ protected Object restoreItemFromMemento(IMemento element) {
return element.getString("resource"); //$NON-NLS-1$
}
/*
* org.eclipse.ui.IMemento)
*/
@Override
- protected void storeItemToMemento(Object item, IMemento element) {
+ protected void storeItemToMemento(Object item, IMemento element) {
element.putString("resource", item.toString()); //$NON-NLS-1$
}
}
-
+
/**
* <p>getNewWizardLinkText</p>
*
* @return a {@link java.lang.String} object.
*/
protected abstract String getNewWizardLinkText();
-
+
/**
* <p>getNewEntityWizard</p>
- * @param parameter
+ * @param parameter
* @return a {@link eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard} object.
*/
protected abstract AbstractNewEntityWizard getNewEntityWizard(String parameter);
-
+
public class FilteredCdmResourceLabelProvider extends LabelProvider {
@Override
- public String getText(Object element) {
+ public String getText(Object element) {
if (element == null) {
return null;
}
return ((UuidAndTitleCache) element).getTitleCache();
- }
+ }
};
/* (non-Javadoc)
}
return null;
}
-
+
protected SelectionListener getNewWizardLinkSelectionListener(){
return new SelectionAdapter() {
-
+
/* (non-Javadoc)
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
AbstractNewEntityWizard wizard = getNewEntityWizard(e.text);
wizard.init(null, null);
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- int status = dialog.open();
-
- if (status == IStatus.OK) {
+ if(wizard.getEntity() != null) {
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ int status = dialog.open();
- T entity = (T) wizard.getEntity();
+ if (status == IStatus.OK) {
-// addObjectToModel(teamOrPerson);
- refresh();
- setPattern(entity);
- getConversationHolder().bind();
+ T entity = (T) wizard.getEntity();
+ refresh();
+ setPattern(entity);
+ getConversationHolder().bind();
+ }
}
}
};
}
-
+
/**
* <p>getConversationHolder</p>
*
* @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
*/
@Override
- public ConversationHolder getConversationHolder() {
+ public ConversationHolder getConversationHolder() {
return conversation;
}
-
+
/** {@inheritDoc} */
@Override
- public void update(CdmDataChangeMap changeEvents) {}
+ public void update(CdmDataChangeMap changeEvents) {}
/**
- * Don't want to add for example a taxon or synonym to itself
- * so filter the list to remove the taxon in question
+ * Don't want to add for example a taxon or synonym to itself
+ * so filter the list to remove the taxon in question
* (<code>cdmBaseToBeFiltered</code>)
* so it is not available in the filtered list.
*/
private void filterExcludedObjects() {
if (model != null && cdmBaseToBeFiltered != null) {
-
+
UuidAndTitleCache uuidAndTitleCacheToRemove = null;
-
+
for (UuidAndTitleCache uuidAndTitleCache : model){
if ((cdmBaseToBeFiltered.getUuid()).equals(uuidAndTitleCache.getUuid())) {
uuidAndTitleCacheToRemove = uuidAndTitleCache;
- }
+ }
}
model.remove(uuidAndTitleCacheToRemove);
}
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
import org.eclipse.ui.forms.widgets.Section;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>Abstract AbstractCdmFormElement class.</p>
// addControl(layoutComposite);
}
- /**
- * <p>Getter for the field <code>formFactory</code>.</p>
- *
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
- */
- public CdmFormFactory getFormFactory() {
+ @Override
+ public CdmFormFactory getFormFactory() {
return formFactory;
}
/** {@inheritDoc} */
@Override
public void firePropertyChangeEvent(CdmPropertyChangeEvent event) {
+ //TODO: replace propertyChangeListeners with formFactory.getPropertyChangeListeners() and remove member propertyChangeListeners from AbstractCdmFormElement
Assert.isNotNull(propertyChangeListeners, "Property change listeners are not present");
try{
import java.util.ArrayList;
import java.util.List;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+
/**
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>
* @param <T>
*/
//TODO shouldn't ENTITY be bound with super class ICdmBase for example (AbstractFormSection<ENTITY extends ICdmBase>)?
-public abstract class AbstractFormSection<ENTITY> extends Section implements
- ISelectionChangedListener, IEntityElement<ENTITY>,
- IConversationEnabled {
+public abstract class AbstractFormSection<ENTITY> extends Section implements ISelectionChangedListener, IEntityElement<ENTITY>, IConversationEnabled {
private ISelectionProvider selectionProvider;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.ui.forms.widgets.TableWrapData;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+
/**
* <p>BrowserElement class.</p>
/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.ui.element;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.ui.campanula.basicFields.NamedAreaFieldController;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsElementController;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralElementController;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventDetailsElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventDetailsElementController;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.DerivedUnitDetailsElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.DerivedUnitDetailsElementController;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.DerivedUnitDetailsSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenDetailsElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenDetailsElementController;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenDetailsSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenGeneralSection;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection.UnitType;
* <p>
* CdmFormFactory class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Feb 24, 2010
* @version 1.0
*/
public class CdmFormFactory extends FormToolkit {
- private BoldFontHolder2 boldFontHolder2;
- private MouseListener selectionMouseHandler;
- private FocusListener selectionFocusHandler;
+ private BoldFontHolder2 boldFontHolder2;
+ private MouseListener selectionMouseHandler;
+ private FocusListener selectionFocusHandler;
private final Set<SelectionListener> selectionListenerList = new HashSet<SelectionListener>();
- private final List<IPropertyChangeListener> propertyChangeListeners = new ArrayList<IPropertyChangeListener>();
+ private final List<IPropertyChangeListener> propertyChangeListeners = new ArrayList<IPropertyChangeListener>();
- private final int orientation = Window.getDefaultOrientation();
- private ISelectionProvider selectionProvider;
+ private final int orientation = Window.getDefaultOrientation();
+ private ISelectionProvider selectionProvider;
- /** Constant <code>EMPTY_SELECTION</code> */
- public static ISelection EMPTY_SELECTION = new ISelection() {
- @Override
- public boolean isEmpty() {
- return true;
- }
- };
-
- /**
- *
- * @author n.hoffmann
- * @date Jan 25, 2010
- *
- */
- private class SelectionMouseHandler extends MouseAdapter {
- @Override
- public void mouseDown(MouseEvent e) {
- notifySelectionListeners(e);
- }
- }
+ /** Constant <code>EMPTY_SELECTION</code> */
+ public static ISelection EMPTY_SELECTION = new ISelection() {
+ @Override
+ public boolean isEmpty() {
+ return true;
+ }
+ };
+
+ /**
+ *
+ * @author n.hoffmann
+ * @date Jan 25, 2010
+ *
+ */
+ private class SelectionMouseHandler extends MouseAdapter {
+ @Override
+ public void mouseDown(MouseEvent e) {
+ notifySelectionListeners(e);
+ }
+ }
- /**
- *
- * @author n.hoffmann
- * @date Jan 25, 2010
- *
- */
- private class SelectionFocusHandler extends FocusAdapter {
- @Override
- public void focusGained(FocusEvent e) {
- notifySelectionListeners(e);
- }
- }
+ /**
+ *
+ * @author n.hoffmann
+ * @date Jan 25, 2010
+ *
+ */
+ private class SelectionFocusHandler extends FocusAdapter {
+ @Override
+ public void focusGained(FocusEvent e) {
+ notifySelectionListeners(e);
+ }
+ }
- private void notifySelectionListeners(TypedEvent e) {
- Event event = new Event();
- event.widget = e.widget;
- SelectionEvent selectionEvent = new SelectionEvent(event);
+ private void notifySelectionListeners(TypedEvent e) {
+ Event event = new Event();
+ event.widget = e.widget;
+ SelectionEvent selectionEvent = new SelectionEvent(event);
for (SelectionListener listener : selectionListenerList) {
listener.widgetSelected(selectionEvent);
- }
- }
-
- /**
- * <p>
- * Constructor for CdmFormFactory.
- * </p>
- *
- * @param display
- * a {@link org.eclipse.swt.widgets.Display} object.
- * @param selectionProvider
- * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
- */
- public CdmFormFactory(Display display, ISelectionProvider selectionProvider) {
- super(display);
- this.selectionProvider = selectionProvider;
- init();
- }
-
- /**
- * <p>
- * Constructor for CdmFormFactory.
- * </p>
- *
- * @param display
- * a {@link org.eclipse.swt.widgets.Display} object.
- */
- public CdmFormFactory(Display display) {
- super(display);
- init();
- }
-
- /**
- *
- */
- private void init() {
- boldFontHolder2 = new BoldFontHolder2();
- selectionMouseHandler = new SelectionMouseHandler();
- selectionFocusHandler = new SelectionFocusHandler();
- }
+ }
+ }
- /**
- * Creates an instance initialized with the correct selectionProvider
- *
- * Make sure to remove the instance when the entityComposite disposes via
- * destroySelectionArbitrator(..)
- *
- * @param entityElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
- * object.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
- * object.
+ /**
+ * <p>
+ * Constructor for CdmFormFactory.
+ * </p>
+ *
+ * @param display
+ * a {@link org.eclipse.swt.widgets.Display} object.
+ * @param selectionProvider
+ * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
+ */
+ public CdmFormFactory(Display display, ISelectionProvider selectionProvider) {
+ super(display);
+ this.selectionProvider = selectionProvider;
+ init();
+ }
+
+ /**
+ * <p>
+ * Constructor for CdmFormFactory.
+ * </p>
+ *
+ * @param display
+ * a {@link org.eclipse.swt.widgets.Display} object.
+ */
+ public CdmFormFactory(Display display) {
+ super(display);
+ init();
+ }
+
+ /**
+ *
*/
+ private void init() {
+ boldFontHolder2 = new BoldFontHolder2();
+ selectionMouseHandler = new SelectionMouseHandler();
+ selectionFocusHandler = new SelectionFocusHandler();
+ }
+
+ /**
+ * Creates an instance initialized with the correct selectionProvider
+ *
+ * Make sure to remove the instance when the entityComposite disposes via
+ * destroySelectionArbitrator(..)
+ *
+ * @param entityElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
+ * object.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
+ * object.
+ */
public SelectionArbitrator createSelectionArbitrator(IEntityElement entityElement) {
SelectionArbitrator selectionArbitrator = new SelectionArbitrator(entityElement);
- selectionArbitrator.addSelectionProvider(selectionProvider);
- selectionProvider.addSelectionChangedListener(selectionArbitrator);
- addSelectionListener(selectionArbitrator);
- return selectionArbitrator;
- }
-
- /**
- * <p>
- * destroySelectionArbitrator
- * </p>
- *
- * @param selectionArbitrator
+ selectionArbitrator.addSelectionProvider(selectionProvider);
+ selectionProvider.addSelectionChangedListener(selectionArbitrator);
+ addSelectionListener(selectionArbitrator);
+ return selectionArbitrator;
+ }
+
+ /**
+ * <p>
+ * destroySelectionArbitrator
+ * </p>
+ *
+ * @param selectionArbitrator
* a
* {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
- * object.
- */
+ * object.
+ */
public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator) {
- removeSelectionListener(selectionArbitrator);
- if (selectionProvider != null) {
+ removeSelectionListener(selectionArbitrator);
+ if (selectionProvider != null) {
selectionProvider.removeSelectionChangedListener(selectionArbitrator);
- } else {
+ } else {
AbstractUtility.error(this.getClass(),
"Tried to destroy a selection listener from this factories listeners but was null", null);
- }
- }
-
- /** {@inheritDoc} */
- @Override
- public void adapt(Composite composite) {
- composite.addMouseListener(selectionMouseHandler);
- super.adapt(composite);
- }
+ }
+ }
- /**
- * <p>
+ /**
+ * <p>
* Adapts the {@link AbstractCdmFormElement}:<br>
* - sets the {@link IPropertyChangeListener}s handled by this class
- * </p>
- *
- * @param formElement
- * a
- * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
- * object.
- */
- public void adapt(AbstractCdmFormElement formElement) {
- formElement.setPropertyChangeListeners(propertyChangeListeners);
- }
-
- /** {@inheritDoc} */
- @Override
- public void adapt(Control control, boolean trackFocus, boolean trackKeyboard) {
- if (trackFocus) {
- control.addFocusListener(selectionFocusHandler);
- }
- super.adapt(control, trackFocus, trackKeyboard);
- }
-
- /**
- * <p>
- * destroyElement
- * </p>
- *
- * @param formElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- */
- public void destroyElement(ICdmFormElement formElement) {
- // return if element was not initialized
- if (formElement == null) {
- return;
- }
- // destroy selection arbitrator, if any
- if (formElement instanceof ISelectableElement) {
+ * </p>
+ *
+ * @param formElement
+ * a
+ * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
+ * object.
+ */
+ public void adapt(AbstractCdmFormElement formElement) {
+ formElement.setPropertyChangeListeners(propertyChangeListeners);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void adapt(Control control, boolean trackFocus, boolean trackKeyboard) {
+ if (trackFocus) {
+ control.addFocusListener(selectionFocusHandler);
+ }
+ super.adapt(control, trackFocus, trackKeyboard);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void adapt(Composite composite) {
+ composite.addMouseListener(selectionMouseHandler);
+ super.adapt(composite);
+ }
+
+ /**
+ * <p>
+ * destroyElement
+ * </p>
+ *
+ * @param formElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ */
+ public void destroyElement(ICdmFormElement formElement) {
+ // return if element was not initialized
+ if (formElement == null) {
+ return;
+ }
+ // destroy selection arbitrator, if any
+ if (formElement instanceof ISelectableElement) {
destroySelectionArbitrator(((ISelectableElement) formElement).getSelectionArbitrator());
- }
- // remove this element form its parents list of elements
- // ICdmFormElement parentElement = formElement.getParentElement();
- // if(parentElement != null){
- // parentElement.removeElement(formElement);
- // }
- // call destroy on child elements recursively
- for (ICdmFormElement childElement : formElement.getElements()) {
- destroyElement(childElement);
- }
- // dispose of the controls
- for (Control control : formElement.getControls()) {
- // we added the layoutComposite of the parental element as the
- // layout composite to this formElement
- // but we do not want to destroy it.
- if (control.equals(formElement.getLayoutComposite())) {
- continue;
- } else {
- control.dispose();
- control = null;
- }
- }
- }
-
- /**
- * <p>
- * createEmptyCell
- * </p>
- *
- * @param parent
- * a {@link org.eclipse.swt.widgets.Composite} object.
- * @return a {@link org.eclipse.swt.widgets.Label} object.
- */
- public Label createEmptyCell(Composite parent) {
- return this.createLabel(parent, null);
- }
+ }
+ // remove this element form its parents list of elements
+ // ICdmFormElement parentElement = formElement.getParentElement();
+ // if(parentElement != null){
+ // parentElement.removeElement(formElement);
+ // }
+ // call destroy on child elements recursively
+ for (ICdmFormElement childElement : formElement.getElements()) {
+ destroyElement(childElement);
+ }
+ // dispose of the controls
+ for (Control control : formElement.getControls()) {
+ // we added the layoutComposite of the parental element as the
+ // layout composite to this formElement
+ // but we do not want to destroy it.
+ if (control.equals(formElement.getLayoutComposite())) {
+ continue;
+ } else {
+ control.dispose();
+ control = null;
+ }
+ }
+ }
- /**
- * <p>
- * createMultilineTextWithLabel
- * </p>
- *
- * @param labelString
- * a {@link java.lang.String} object.
- * @param textHeight
- * a int.
- * @param style
- * a int.
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
- * object.
- */
+ /**
+ * <p>
+ * createEmptyCell
+ * </p>
+ *
+ * @param parent
+ * a {@link org.eclipse.swt.widgets.Composite} object.
+ * @return a {@link org.eclipse.swt.widgets.Label} object.
+ */
+ public Label createEmptyCell(Composite parent) {
+ return this.createLabel(parent, null);
+ }
+
+ /**
+ * <p>
+ * createMultilineTextWithLabel
+ * </p>
+ *
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param textHeight
+ * a int.
+ * @param style
+ * a int.
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
+ * object.
+ */
public TextWithLabelElement createMultilineTextWithLabel(ICdmFormElement parentElement, String labelString,
int textHeight, int style) {
TextWithLabelElement element = new TextWithLabelElement(this, parentElement, labelString, "", textHeight, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createMultiLanguageTextElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param labelString
- * a {@link java.lang.String} object.
- * @param multilanguageText
- * a {@link java.util.Map} object.
- * @param textHeight
- * a int.
- * @param style
- * a int.
- * @return a
- * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
- * object.
- */
+ /**
+ * <p>
+ * createMultiLanguageTextElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param multilanguageText
+ * a {@link java.util.Map} object.
+ * @param textHeight
+ * a int.
+ * @param style
+ * a int.
+ * @return a
+ * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
+ * object.
+ */
public MultilanguageTextElement createMultiLanguageTextElement(ICdmFormElement parentElement, String labelString,
Map<Language, LanguageString> multilanguageText, int textHeight, int style) {
MultilanguageTextElement element = new MultilanguageTextElement(this, parentElement, labelString,
multilanguageText, textHeight, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
public KeyStatementElement createKeyStatementElement(ICdmFormElement parentElement, String labelString,
- KeyStatement keyStatement, int textHeight, int style) {
+ KeyStatement keyStatement, int textHeight, int style) {
KeyStatementElement element = new KeyStatementElement(this, parentElement, labelString, keyStatement,
textHeight, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createTextWithLabelElement
- * </p>
- *
- * @param labelString
- * a {@link java.lang.String} object.
- * @param initialText
- * a {@link java.lang.String} object.
- * @param style
- * a int.
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
- * object.
- */
+ /**
+ * <p>
+ * createTextWithLabelElement
+ * </p>
+ *
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param initialText
+ * a {@link java.lang.String} object.
+ * @param style
+ * a int.
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
+ * object.
+ */
public TextWithLabelElement createTextWithLabelElement(ICdmFormElement parentElement, String labelString,
- String initialText, int style) {
+ String initialText, int style) {
TextWithLabelElement element = new TextWithLabelElement(this, parentElement, labelString, initialText, null,
style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
public UriWithLabelElement createUriWithLabelElement(ICdmFormElement parentElement, String labelString,
URI initialUri, int style) {
UriWithLabelElement element = new UriWithLabelElement(this, parentElement, labelString, initialUri, null, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * @param element
- * @param string
- * @param uri
- * @param style
- * @return
- */
+ /**
+ * @param element
+ * @param string
+ * @param uri
+ * @param style
+ * @return
+ */
public OpenUrlSelectorElement createOpenUrlSelectorElement(ICdmFormElement parentElement, String labelString,
- IOpenUrlEnabled openUrlEnabled, int style) {
+ IOpenUrlEnabled openUrlEnabled, int style) {
OpenUrlSelectorElement element = new OpenUrlSelectorElement(this, parentElement, labelString, openUrlEnabled,
style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- *
- * @param parentElement
- * @param labelString
- * @param conversationEnabled
- * @param user
- * @param style
- * @return
- */
+ /**
+ *
+ * @param parentElement
+ * @param labelString
+ * @param conversationEnabled
+ * @param user
+ * @param style
+ * @return
+ */
public EditPasswordElement createEditPasswordElement(ICdmFormElement parentElement, String labelString,
- ConversationHolder conversation, User user, int style) {
+ ConversationHolder conversation, User user, int style) {
EditPasswordElement element = new EditPasswordElement(this, parentElement, labelString, user, conversation);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createIntegerTextWithLabelElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param labelString
- * a {@link java.lang.String} object.
- * @param initialInteger
- * a {@link java.lang.Integer} object.
- * @param style
- * a int.
+ /**
+ * <p>
+ * createIntegerTextWithLabelElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param initialInteger
+ * a {@link java.lang.Integer} object.
+ * @param style
+ * a int.
* @return a
* {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
- * object.
- */
+ * object.
+ */
public NumberWithLabelElement createNumberTextWithLabelElement(
ICdmFormElement parentElement, String labelString,
Number initialNumber, int style) {
return element;
}
-
- /**
- * <p>
- * createLanguageStringWithLabelElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param labelString
- * a {@link java.lang.String} object.
- * @param languageString
- * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
- * @param style
- * a int.
- * @return a
- * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
- * object.
- */
+ /**
+ * <p>
+ * createLanguageStringWithLabelElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param languageString
+ * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
+ * @param style
+ * a int.
+ * @return a
+ * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
+ * object.
+ */
public LanguageStringWithLabelElement createLanguageStringWithLabelElement(ICdmFormElement parentElement,
String labelString, LanguageString languageString, int style) {
LanguageStringWithLabelElement element = new LanguageStringWithLabelElement(this, parentElement, labelString,
languageString, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createLanguageStringWithLabelElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param labelString
- * a {@link java.lang.String} object.
- * @param languageString
- * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
- * @param height
- * a int.
- * @param style
- * a int.
- * @return a
- * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
- * object.
- */
+ /**
+ * <p>
+ * createLanguageStringWithLabelElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param languageString
+ * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
+ * @param height
+ * a int.
+ * @param style
+ * a int.
+ * @return a
+ * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
+ * object.
+ */
public LanguageStringWithLabelElement createLanguageStringWithLabelElement(ICdmFormElement parentElement,
String labelString, LanguageString languageString, int height, int style) {
LanguageStringWithLabelElement element = new LanguageStringWithLabelElement(this, parentElement, labelString,
languageString, height, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createTextElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param initialText
- * a {@link java.lang.String} object.
- * @param style
- * a int.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
- * object.
- */
+ /**
+ * <p>
+ * createTextElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param initialText
+ * a {@link java.lang.String} object.
+ * @param style
+ * a int.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
+ * object.
+ */
public TextWithLabelElement createTextElement(ICdmFormElement parentElement, String initialText, int style) {
TextWithLabelElement element = new TextWithLabelElement(this, parentElement, null, initialText, null, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createKeyValueViewerElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param keyHeading
- * a {@link java.lang.String} object.
- * @param valueHeading
- * a {@link java.lang.String} object.
- * @param map
- * a {@link java.util.Map} object.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
- * object.
- */
+ /**
+ * <p>
+ * createKeyValueViewerElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param keyHeading
+ * a {@link java.lang.String} object.
+ * @param valueHeading
+ * a {@link java.lang.String} object.
+ * @param map
+ * a {@link java.util.Map} object.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
+ * object.
+ */
public KeyValueViewerElement createKeyValueViewerElement(ICdmFormElement parentElement, String keyHeading,
- String valueHeading, Map<Object, Object> map) {
+ String valueHeading, Map<Object, Object> map) {
KeyValueViewerElement element = new KeyValueViewerElement(this, parentElement, keyHeading, valueHeading, map);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
+ /**
+ * <p>
+ * createTermComboElement
+ * </p>
+ *
+ * @param termComboType
+ * a
+ * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
+ * object.
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param selection
+ * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
+ * object.
+ * @param style
+ * a int.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
+ * object.
+ */
- /**
- * <p>
- * createTermComboElement
- * </p>
- *
- * @param termComboType
- * a
- * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
- * object.
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param labelString
- * a {@link java.lang.String} object.
- * @param selection
- * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
- * object.
- * @param style
- * a int.
- * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
- * object.
- */
-
public <T extends DefinedTermBase> TermComboElement<T> createTermComboElement(Class<T> termComboType,
ICdmFormElement parentElement, String labelString, T selection, int style) {
TermComboElement<T> element = new TermComboElement<T>(this, parentElement, termComboType, labelString,
selection, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
-
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
/**
* <p>
* createTermComboElement
* </p>
- *
+ *
* @param termComboType
* a
* {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
* @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
* object.
*/
-
+
public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
- TermType termType,
+ TermType termType,
ICdmFormElement parentElement,
- String labelString,
- T selection,
+ String labelString,
+ T selection,
int style) {
TermComboElement<T> element = new TermComboElement<T>(this, parentElement, termType, labelString, selection, style);
adapt(element);
return element;
}
- /**
- * <p>
- * createEnumComboElement
- * </p>
- *
- * @param enumComboType
- * a
- * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
- * object.
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param style
- * a int.
- * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
- * object.
- */
+ /**
+ * <p>
+ * createEnumComboElement
+ * </p>
+ *
+ * @param enumComboType
+ * a
+ * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
+ * object.
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param style
+ * a int.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
+ * object.
+ */
public <T extends IEnumTerm> EnumComboElement<T> createEnumComboElement(
Class<T> enumComboType, ICdmFormElement parentElement,
int style) {
- EnumComboElement<T> element = new EnumComboElement<T>(this, parentElement, enumComboType, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ EnumComboElement<T> element = new EnumComboElement<T>(this, parentElement, enumComboType, style);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createBrowserElement
- * </p>
- *
- * @param imageUri
- * a {@link java.net.URI} object.
- * @param style
- * a int.
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
+ /**
+ * <p>
+ * createBrowserElement
+ * </p>
+ *
+ * @param imageUri
+ * a {@link java.net.URI} object.
+ * @param style
+ * a int.
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
* @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
* object.
- */
+ */
public BrowserElement createBrowserElement(ICdmFormElement parentElement, URI imageUri, int style) {
BrowserElement element = new BrowserElement(this, parentElement, imageUri, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
-
- /**
- * <p>
- * createImageElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param imageUri
- * a {@link java.net.URI} object.
- * @param style
- * a int.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
- */
- public ImageElement createImageElement(ICdmFormElement parentElement, URI imageUri, int style) {
- ImageElement element = new ImageElement(this, parentElement, imageUri, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createTextActionElement
- * </p>
- *
- * @param labelString
- * a {@link java.lang.String} object.
- * @param initialText
- * a {@link java.lang.String} object.
- * @param style
- * a int.
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param buttonLabel
- * a {@link java.lang.String} object.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
- * object.
- */
+ /**
+ * <p>
+ * createImageElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param imageUri
+ * a {@link java.net.URI} object.
+ * @param style
+ * a int.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
+ */
+ public ImageElement createImageElement(ICdmFormElement parentElement, URI imageUri, int style) {
+ ImageElement element = new ImageElement(this, parentElement, imageUri, style);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
+ /**
+ * <p>
+ * createTextActionElement
+ * </p>
+ *
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param initialText
+ * a {@link java.lang.String} object.
+ * @param style
+ * a int.
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param buttonLabel
+ * a {@link java.lang.String} object.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
+ * object.
+ */
public TextActionElement createTextActionElement(ICdmFormElement parentElement, String labelString,
- String buttonLabel, String initialText, int style) {
+ String buttonLabel, String initialText, int style) {
TextActionElement element = new TextActionElement(this, parentElement, labelString, buttonLabel, initialText,
style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createCheckbox
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param label
- * a {@link java.lang.String} object.
- * @param initialState
- * a boolean.
- * @param style
- * a int.
+ /**
+ * <p>
+ * createCheckbox
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param label
+ * a {@link java.lang.String} object.
+ * @param initialState
+ * a boolean.
+ * @param style
+ * a int.
* @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
* object.
- */
+ */
public CheckboxElement createCheckbox(ICdmFormElement parentElement, String label, boolean initialState, int style) {
CheckboxElement element = new CheckboxElement(this, parentElement, label, initialState, style | orientation);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * Creates a section as a part of the form.
- *
- * @return the section widget
- * @param section
+ /**
+ * Creates a section as a part of the form.
+ *
+ * @return the section widget
+ * @param section
* a
* {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
- * object.
- */
- public Section adapt(AbstractFormSection section) {
- section.setMenu(section.getLayoutComposite().getMenu());
- adapt(section, true, true);
+ * object.
+ */
+ public Section adapt(AbstractFormSection section) {
+ section.setMenu(section.getLayoutComposite().getMenu());
+ adapt(section, true, true);
- // handle focus and property change events for cdm use
- section.addFocusListener(selectionFocusHandler);
- section.setPropertyChangeListeners(propertyChangeListeners);
+ // handle focus and property change events for cdm use
+ section.addFocusListener(selectionFocusHandler);
+ section.setPropertyChangeListeners(propertyChangeListeners);
- if (section.getToggle() != null) {
+ if (section.getToggle() != null) {
section.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors.TB_TOGGLE_HOVER));
section.getToggle().setDecorationColor(getColors().getColor(IFormColors.TB_TOGGLE));
- }
+ }
section.setFont(boldFontHolder2.getBoldFont(section.getLayoutComposite().getFont()));
if ((section.getStyle() & ExpandableComposite.TITLE_BAR) != 0
|| (section.getStyle() & ExpandableComposite.SHORT_TITLE_BAR) != 0) {
- getColors().initializeSectionToolBarColors();
+ getColors().initializeSectionToolBarColors();
section.setTitleBarBackground(getColors().getColor(IFormColors.TB_BG));
section.setTitleBarBorderColor(getColors().getColor(IFormColors.TB_BORDER));
- }
- // call setTitleBarForeground regardless as it also sets the label color
+ }
+ // call setTitleBarForeground regardless as it also sets the label color
section.setTitleBarForeground(getColors().getColor(IFormColors.TB_TOGGLE));
- return section;
- }
+ return section;
+ }
- private class BoldFontHolder2 {
- private Font normalFont;
+ private class BoldFontHolder2 {
+ private Font normalFont;
- private Font boldFont;
+ private Font boldFont;
- public BoldFontHolder2() {
- }
+ public BoldFontHolder2() {
+ }
- public Font getBoldFont(Font font) {
- createBoldFont(font);
- return boldFont;
- }
+ public Font getBoldFont(Font font) {
+ createBoldFont(font);
+ return boldFont;
+ }
- private void createBoldFont(Font font) {
- if (normalFont == null || !normalFont.equals(font)) {
- normalFont = font;
- dispose();
- }
- if (boldFont == null) {
+ private void createBoldFont(Font font) {
+ if (normalFont == null || !normalFont.equals(font)) {
+ normalFont = font;
+ dispose();
+ }
+ if (boldFont == null) {
boldFont = FormFonts.getInstance().getBoldFont(getColors().getDisplay(), normalFont);
- }
- }
+ }
+ }
- public void dispose() {
- if (boldFont != null) {
+ public void dispose() {
+ if (boldFont != null) {
FormFonts.getInstance().markFinished(boldFont, getColors().getDisplay());
- boldFont = null;
- }
- }
- }
+ boldFont = null;
+ }
+ }
+ }
- /**
- * <p>
- * createToggleableTextField
- * </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 initialState
- * a boolean.
- * @param style
- * a int.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
- * object.
- */
+ /**
+ * <p>
+ * createToggleableTextField
+ * </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 initialState
+ * a boolean.
+ * @param style
+ * a int.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
+ * object.
+ */
public ToggleableTextElement createToggleableTextField(ICdmFormElement parentElement, String labelString,
- String initialText, boolean initialState, int style) {
+ String initialText, boolean initialState, int style) {
ToggleableTextElement element = new ToggleableTextElement(this, parentElement, labelString, initialText,
initialState, style | orientation);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createTimePeriodElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param labelString
- * a {@link java.lang.String} object.
- * @param timePeriod
- * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
- * @param style
- * a int.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
- * object.
- */
+ /**
+ * <p>
+ * createTimePeriodElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param timePeriod
+ * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
+ * @param style
+ * a int.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
+ * object.
+ */
public TimePeriodElement createTimePeriodElement(ICdmFormElement parentElement, String labelString,
- TimePeriod timePeriod, int style) {
+ TimePeriod timePeriod, int style) {
TimePeriodElement element = new TimePeriodElement(this, parentElement, labelString, timePeriod, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
-
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
/**
* <p>
* createGatheringEventUnitElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* object.
*/
public GatheringEventUnitElement createGatheringEventUnitElement(
- ICdmFormElement parentElement,
+ ICdmFormElement parentElement,
String labelString,
- DerivedUnitFacade gatheringEvent,
- MinMaxTextSection.UnitType unitType,
+ DerivedUnitFacade gatheringEvent,
+ MinMaxTextSection.UnitType unitType,
int style) {
- GatheringEventUnitElement element = new GatheringEventUnitElement(this,
+ GatheringEventUnitElement element = new GatheringEventUnitElement(this,
parentElement,
- labelString,
- gatheringEvent,
+ labelString,
+ gatheringEvent,
unitType,
style);
adapt(element);
return element;
}
- /**
- * <p>
- * createPointElement
- * </p>
- *
- * @param style
- * a int.
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param point
- * a {@link eu.etaxonomy.cdm.model.location.Point} object.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
- */
+ /**
+ * <p>
+ * createPointElement
+ * </p>
+ *
+ * @param style
+ * a int.
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param point
+ * a {@link eu.etaxonomy.cdm.model.location.Point} object.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
+ */
public PointElement createPointElement(ICdmFormElement parentElement, Point point, int style) {
PointElement element = new PointElement(this, parentElement, point, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createDateDetailSection
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param style
- * a int.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
- * object.
- */
+ /**
+ * <p>
+ * createDateDetailSection
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param style
+ * a int.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
+ * object.
+ */
public DateDetailSection createDateDetailSection(ICdmFormElement parentElement, int style) {
DateDetailSection section = new DateDetailSection(this, parentElement, style);
- parentElement.addElement(section);
- adapt(section);
- return section;
- }
-
+ parentElement.addElement(section);
+ adapt(section);
+ return section;
+ }
+
/**
* <p>
* createDateDetailSection
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
return section;
}
- /**
- * <p>
- * createPartialElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param labelString
- * a {@link java.lang.String} object.
- * @param partial
- * a {@link org.joda.time.Partial} object.
- * @param style
- * a int.
+ /**
+ * <p>
+ * createPartialElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param partial
+ * a {@link org.joda.time.Partial} object.
+ * @param style
+ * a int.
* @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
* object.
- */
+ */
public PartialElement createPartialElement(ICdmFormElement parentElement, String labelString, Partial partial,
int style) {
PartialElement element = new PartialElement(this, parentElement, labelString, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
-
- /**
- * <p>
- * addSelectionListener
- * </p>
- *
- * @param listener
- * a {@link org.eclipse.swt.events.SelectionListener} object.
- */
- public void addSelectionListener(SelectionListener listener) {
- selectionListenerList.add(listener);
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * removeSelectionListener
- * </p>
- *
- * @param listener
- * a {@link org.eclipse.swt.events.SelectionListener} object.
- */
- public void removeSelectionListener(SelectionListener listener) {
- if (listener == null) {
+ /**
+ * <p>
+ * addSelectionListener
+ * </p>
+ *
+ * @param listener
+ * a {@link org.eclipse.swt.events.SelectionListener} object.
+ */
+ public void addSelectionListener(SelectionListener listener) {
+ selectionListenerList.add(listener);
+ }
+
+ /**
+ * <p>
+ * removeSelectionListener
+ * </p>
+ *
+ * @param listener
+ * a {@link org.eclipse.swt.events.SelectionListener} object.
+ */
+ public void removeSelectionListener(SelectionListener listener) {
+ if (listener == null) {
AbstractUtility.error(this.getClass(),
"Tried to remove a selection listener from this factories listeners but was null", null);
- } else {
- selectionListenerList.remove(listener);
- }
- }
-
- /**
- * <p>
- * addPropertyChangeListener
- * </p>
- *
- * @param listener
- * a {@link org.eclipse.jface.util.IPropertyChangeListener}
- * object.
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
- if(propertyChangeListeners.contains(listener)){
- return;
- }
- propertyChangeListeners.add(0, listener);
- }
-
- /**
- * <p>
- * removePropertyChangeListener
- * </p>
- *
- * @param listener
- * a {@link org.eclipse.jface.util.IPropertyChangeListener}
- * object.
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
- propertyChangeListeners.remove(listener);
- }
+ } else {
+ selectionListenerList.remove(listener);
+ }
+ }
- /**
- * <p>
- * createHorizontalSeparator
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param style
- * a int.
- * @return a {@link org.eclipse.swt.widgets.Label} object.
- */
+ /**
+ * <p>
+ * addPropertyChangeListener
+ * </p>
+ *
+ * @param listener
+ * a {@link org.eclipse.jface.util.IPropertyChangeListener}
+ * object.
+ */
+ public void addPropertyChangeListener(IPropertyChangeListener listener) {
+ if (propertyChangeListeners.contains(listener)) {
+ return;
+ }
+ propertyChangeListeners.add(0, listener);
+ }
+
+ /**
+ * <p>
+ * removePropertyChangeListener
+ * </p>
+ *
+ * @param listener
+ * a {@link org.eclipse.jface.util.IPropertyChangeListener}
+ * object.
+ */
+ public void removePropertyChangeListener(IPropertyChangeListener listener) {
+ propertyChangeListeners.remove(listener);
+ }
+
+ /**
+ * @return the propertyChangeListeners
+ */
+ public List<IPropertyChangeListener> getPropertyChangeListeners() {
+ return propertyChangeListeners;
+ }
+
+ /**
+ * <p>
+ * createHorizontalSeparator
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param style
+ * a int.
+ * @return a {@link org.eclipse.swt.widgets.Label} object.
+ */
public Label createHorizontalSeparator(ICdmFormElement parentElement, int style) {
Label separator = this.createSeparator(parentElement.getLayoutComposite(), SWT.HORIZONTAL | style);
- separator.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
- return separator;
- }
-
- /**
- * <p>
- * createVersionElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param entity
- * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
- * object.
- * @param style
- * a int.
- * @return a
- * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
- * object.
- */
+ separator.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
+ return separator;
+ }
+
+ /**
+ * <p>
+ * createVersionElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param entity
+ * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
+ * object.
+ * @param style
+ * a int.
+ * @return a
+ * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
+ * object.
+ */
public VersionElement createVersionElement(ICdmFormElement parentElement, VersionableEntity entity, int style) {
VersionElement element = new VersionElement(this, parentElement, entity, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
-
- /**
- * @param cdmBaseSection
- * @param object
- * @param style
- * @return
- */
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
+ /**
+ * @param cdmBaseSection
+ * @param object
+ * @param style
+ * @return
+ */
public CdmBaseElement createCdmBaseElement(ICdmFormElement parentElement, CdmBase entity, int style) {
CdmBaseElement element = new CdmBaseElement(this, parentElement, entity, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
-
-
- /**
- * <p>
- * createVersionSection
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param style
- * a int.
- * @return a
- * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
- * object.
- */
- public VersionSection createVersionSection(ICdmFormElement parentElement, int style) {
- VersionSection section = new VersionSection(this, parentElement, style);
- parentElement.addElement(section);
- adapt(section);
- return section;
- }
-
- /**
- * @param parent
- * @param i
- * @return
- */
- public CdmBaseSection createCdmBaseSection(ICdmFormElement parentElement, int style) {
- CdmBaseSection section = new CdmBaseSection(this, parentElement, style);
- parentElement.addElement(section);
- adapt(section);
- return section;
- }
-
- /**
- * <p>
- * createEmptyElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
- */
- public EmptyElement createEmptyElement(ICdmFormElement parentElement) {
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
+ /**
+ * <p>
+ * createVersionSection
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param style
+ * a int.
+ * @return a
+ * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
+ * object.
+ */
+ public VersionSection createVersionSection(ICdmFormElement parentElement, int style) {
+ VersionSection section = new VersionSection(this, parentElement, style);
+ parentElement.addElement(section);
+ adapt(section);
+ return section;
+ }
+
+ /**
+ * @param parent
+ * @param i
+ * @return
+ */
+ public CdmBaseSection createCdmBaseSection(ICdmFormElement parentElement, int style) {
+ CdmBaseSection section = new CdmBaseSection(this, parentElement, style);
+ parentElement.addElement(section);
+ adapt(section);
+ return section;
+ }
+
+ /**
+ * <p>
+ * createEmptyElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
+ */
+ public EmptyElement createEmptyElement(ICdmFormElement parentElement) {
EmptyElement element = new EmptyElement(this, parentElement, null, SWT.NULL);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createHeadlineSection
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @return a
- * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
- * object.
- */
- public HeadlineSection createHeadlineSection(ICdmFormElement parentElement) {
+ /**
+ * <p>
+ * createHeadlineSection
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @return a
+ * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
+ * object.
+ */
+ public HeadlineSection createHeadlineSection(ICdmFormElement parentElement) {
HeadlineSection section = new HeadlineSection(this, parentElement, SWT.NULL);
- parentElement.addElement(section);
- adapt(section);
- return section;
- }
-
- /**
- * <p>
- * createParsingMessageElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param parserProblem
- * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
- * object.
- * @param style
- * a int.
- * @return a
- * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
- * object.
- */
+ parentElement.addElement(section);
+ adapt(section);
+ return section;
+ }
+
+ /**
+ * <p>
+ * createParsingMessageElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param parserProblem
+ * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
+ * object.
+ * @param style
+ * a int.
+ * @return a
+ * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
+ * object.
+ */
public ParsingMessageElement createParsingMessageElement(ICdmFormElement parentElement,
ParserProblem parserProblem, int style) {
ParsingMessageElement element = new ParsingMessageElement(this, parentElement, parserProblem, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
public AbstractFormSection createDefinedTermDetailSection(Class definedTermClass, ConversationHolder conversation,
ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
AbstractFormSection section = new DefinedTermDetailSection(this, definedTermClass, conversation, parentElement,
selectionProvider, style);
-
- parentElement.addElement(section);
- adapt(section);
- return section;
-
- }
-
- /**
- * @param definedTermClass
- * @param formElement
- * @param style
- * @return
- */
+
+ parentElement.addElement(section);
+ adapt(section);
+ return section;
+
+ }
+
+ /**
+ * @param definedTermClass
+ * @param formElement
+ * @param style
+ * @return
+ */
public AbstractCdmDetailElement createDefinedTermDetailElement(Class definedTermClass, AbstractCdmDetailSection parentElement, int style) {
- AbstractCdmDetailElement element = null;
-
- if (NamedArea.class.isAssignableFrom(definedTermClass)){
- element = new eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement(this, parentElement);
+ AbstractCdmDetailElement element = null;
+
+ if (NamedArea.class.isAssignableFrom(definedTermClass)) {
+ element = new eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement(this, parentElement);
} else {
- element = new DefinedTermDetailElement(this, parentElement);
- }
-
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ element = new DefinedTermDetailElement(this, parentElement);
+ }
+
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
//--------DetailSections---------
return section;
}
+ public GatheringEventDetailSection createGatheringSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+ GatheringEventDetailSection section = new GatheringEventDetailSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
public NamedAreaDetailSection createNamedAreaDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
NamedAreaDetailSection section = new NamedAreaDetailSection(this, conversation, parentElement, selectionProvider, style);
return section;
}
- public GeneralDetailSection createFOSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
- GeneralDetailSection section = new GeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
- addAndAdaptSection(parentElement, section);
- return section;
- }
-
- public GatheringEventDetailSection createGatheringSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
- GatheringEventDetailSection section = new GatheringEventDetailSection(this, conversation, parentElement, selectionProvider, style);
- addAndAdaptSection(parentElement, section);
- return section;
- }
-
- public FieldObservationDetailSection createFODetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
- FieldObservationDetailSection section = new FieldObservationDetailSection(this, conversation, parentElement, selectionProvider, style);
- addAndAdaptSection(parentElement, section);
- return section;
- }
-
private void addAndAdaptSection(ICdmFormElement parentElement, AbstractFormSection<?> section) {
- parentElement.addElement(section);
- adapt(section);
- }
+ parentElement.addElement(section);
+ adapt(section);
+ }
//--------DetailElements------------
addAndAdaptElement(parentElement, element);
return element;
}
-
-
+
+
public GeneralDetailElement createGeneralDetailElement(ICdmFormElement parentElement){
GeneralDetailElement element = new GeneralDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
return element;
}
+
public GatheringEventDetailElement createGatheringEventDetailElement(ICdmFormElement parentElement) {
GatheringEventDetailElement element = new GatheringEventDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
return element;
- }
+ }
public FieldObservationDetailElement createFieldObservationDetailElement(ICdmFormElement parentElement) {
FieldObservationDetailElement element = new FieldObservationDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
return element;
- }
+ }
+
public DerivedUnitBaseDetailElement createDerivedUnitBaseDetailElement(ICdmFormElement parentElement) {
DerivedUnitBaseDetailElement element = new DerivedUnitBaseDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
- return element;
- }
+ return element;
+ }
public DeterminationDetailElement createDeterminationDetailElement(ICdmFormElement parentElement) {
DeterminationDetailElement element = new DeterminationDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
return element;
- }
+ }
- /**
- * @param parentElement
+ /**
+ * @param parentElement
* @param element
- */
+ */
private void addAndAdaptElement(ICdmFormElement parentElement, AbstractCdmDetailElement<?> element) {
adapt(element);
parentElement.addElement(element);
GroupsByUserDetailSection section = new GroupsByUserDetailSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
return section;
- }
+ }
public TaxonomicScopeSection createTaxonomicScopeSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
TaxonomicScopeSection section = new TaxonomicScopeSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
- return section;
- }
+ return section;
+ }
- /**
- * <p>
- * createEntityCollectionElement
- * </p>
- *
- * @param removeListener
- * a {@link org.eclipse.swt.events.SelectionListener} object.
- * @param style
- * a int.
- * @param parentElement
+ /**
+ * <p>
+ * createEntityCollectionElement
+ * </p>
+ *
+ * @param removeListener
+ * a {@link org.eclipse.swt.events.SelectionListener} object.
+ * @param style
+ * a int.
+ * @param parentElement
* a
* {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
- * object.
- * @param versionableEntity
- * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
- * object.
- * @param backgroundColor
- * a {@link org.eclipse.swt.graphics.Color} object.
- * @return a
- * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
- * object.
- */
+ * object.
+ * @param versionableEntity
+ * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
+ * object.
+ * @param backgroundColor
+ * a {@link org.eclipse.swt.graphics.Color} object.
+ * @return a
+ * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
+ * object.
+ */
public AbstractEntityCollectionElement createEntityCollectionElement(AbstractFormSection parentElement,
Object versionableEntity, SelectionListener removeListener, Color backgroundColor, int style) {
- AbstractEntityCollectionElement element = null;
+ AbstractEntityCollectionElement element = null;
- Object entity = HibernateProxyHelper.deproxy(versionableEntity);
+ Object entity = HibernateProxyHelper.deproxy(versionableEntity);
- if (entity instanceof Annotation) {
+ if (entity instanceof Annotation) {
element = new AnnotationElement(this, parentElement, (Annotation) entity, removeListener, style);
- } else if (entity instanceof Person) {
+ } else if (entity instanceof Person) {
element = new TeamMemberElement(this, parentElement, (Person) entity, removeListener, style);
- } else if (entity instanceof Credit) {
+ } else if (entity instanceof Credit) {
element = new CreditElement(this, parentElement, (Credit) entity, removeListener, style);
- } else if (entity instanceof Extension) {
+ } else if (entity instanceof Extension) {
element = new ExtensionElement(this, parentElement, (Extension) entity, removeListener, style);
- } else if (entity instanceof Marker) {
+ } else if (entity instanceof Marker) {
element = new MarkerElement(this, parentElement, (Marker) entity, removeListener, style);
- } else if (entity instanceof Media) {
+ } else if (entity instanceof Media) {
element = new MediaElement(this, parentElement, (Media) entity, removeListener, style);
- } else if (entity instanceof MediaRepresentation) {
+ } else if (entity instanceof MediaRepresentation) {
element = new MediaRepresentationElement(this, parentElement, (MediaRepresentation) entity, removeListener,
style);
- } else if (entity instanceof ImageFile) {
+ } else if (entity instanceof ImageFile) {
element = new ImageFileElement(this, parentElement, (ImageFile) entity, removeListener, style);
- } else if (entity instanceof MediaRepresentationPart){
+ } else if (entity instanceof MediaRepresentationPart) {
element = new MediaRepresentationPartElement(this, parentElement, (MediaRepresentationPart) entity,
removeListener, style);
- } else if (entity instanceof NomenclaturalStatus) {
+ } else if (entity instanceof NomenclaturalStatus) {
element = new NomenclaturalStatusElement(this, parentElement, (NomenclaturalStatus) entity, removeListener,
style);
- } else if (entity instanceof Rights) {
+ } else if (entity instanceof Rights) {
element = new RightsElement(this, parentElement, (Rights) entity, removeListener, style);
} else if (entity instanceof DescriptionElementSource) {
element = new DescriptionElementSourceElement(this, parentElement, (DescriptionElementSource) entity,
- removeListener, style);
- } else if (entity instanceof IdentifiableSource) {
+ removeListener, style);
+ } else if (entity instanceof IdentifiableSource) {
element = new IdentifiableSourceElement(this, parentElement, (IdentifiableSource) entity, removeListener,
style);
} else if (entity instanceof DefinedTerm) {
switch(((DefinedTerm)entity).getTermType()) {
case Scope:
- element = new ScopeElement(this,
- parentElement,
+ element = new ScopeElement(this,
+ parentElement,
(DefinedTerm) entity,
- removeListener,
+ removeListener,
style);
break;
case Modifier:
- element = new ModifierElement(this,
+ element = new ModifierElement(this,
parentElement,
- (DefinedTerm) entity,
- removeListener,
+ (DefinedTerm) entity,
+ removeListener,
style);
break;
default:
//FIXME : Actually we should through an exception here
element = null;
break;
-
+
}
- } else if (entity instanceof Reference) {
+ } else if (entity instanceof Reference) {
element = new DescriptionSourceElement(this, parentElement, (Reference) entity, removeListener, style);
- } else if (entity instanceof NameTypeDesignation) {
+ } else if (entity instanceof NameTypeDesignation) {
element = new NameTypeDesignationElement(this, parentElement, (NameTypeDesignation) entity, removeListener,
style);
- } else if (entity instanceof NameRelationship) {
+ } else if (entity instanceof NameRelationship) {
element = new NameRelationshipDetailElement(this, parentElement, (NameRelationship) entity, removeListener,
style);
- } else if (entity instanceof SpecimenTypeDesignation) {
+ } else if (entity instanceof SpecimenTypeDesignation) {
element = new SpecimenTypeDesignationElement(this, parentElement, (SpecimenTypeDesignation) entity,
removeListener, style);
- } else if (entity instanceof StateData) {
+ } else if (entity instanceof StateData) {
element = new StateDataElement(this, parentElement, (StateData) entity, removeListener, style);
- } else if (entity instanceof StatisticalMeasurementValue) {
+ } else if (entity instanceof StatisticalMeasurementValue) {
element = new StatisticalMeasurementValueElement(this, parentElement, (StatisticalMeasurementValue) entity,
- removeListener, style);
- } else if (entity instanceof DerivedUnit) {
- switch(((DerivedUnit)entity).getRecordBasis()) {
+ removeListener, style);
+ } else if (entity instanceof DerivedUnit) {
+ switch(((DerivedUnit)entity).getRecordBasis()) {
case LivingSpecimen:
case PreservedSpecimen:
case OtherSpecimen:
- element = new SpecimenCollectionDetailElement(this,
+ element = new SpecimenCollectionDetailElement(this,
parentElement,
- (DerivedUnit) entity,
- removeListener,
+ (DerivedUnit) entity,
+ removeListener,
style);
break;
default:
- element = new DerivedUnitElement(this,
+ element = new DerivedUnitElement(this,
parentElement,
- (DerivedUnit) entity,
- removeListener,
+ (DerivedUnit) entity,
+ removeListener,
style);
- }
+ }
- } else if (entity instanceof NamedArea) {
+ } else if (entity instanceof NamedArea) {
element = new NamedAreaDetailElement(this, parentElement, (NamedArea) entity, removeListener, style);
- } else if (entity instanceof DeterminationEvent) {
- element = new DeterminationEventDetailElement(this, parentElement, (DeterminationEvent) entity,
- removeListener, style);
- } else if (entity instanceof User) {
+ } else if (entity instanceof DeterminationEvent) {
+ element = new DeterminationEventDetailElement(this, parentElement, (DeterminationEvent) entity, removeListener, style);
+ } else if (entity instanceof User) {
element = new MemberDetailElement(this, parentElement, (User) entity, removeListener, style);
- } else if (entity instanceof GrantedAuthority) {
+ } else if (entity instanceof GrantedAuthority) {
element = new GrantedAuthorityCollectionElement(this, parentElement, (GrantedAuthorityImpl) entity,
removeListener, style);
- } else if (entity instanceof Group) {
+ } else if (entity instanceof Group) {
element = new GroupsByUserDetailElement(this, parentElement, (Group) entity, removeListener, style);
- } else if (entity instanceof Taxon) {
+ } else if (entity instanceof Taxon) {
element = new TaxonDetailElement(this, parentElement, (Taxon) entity, removeListener, style);
- } else if (entity instanceof DescriptionElementBase) {
- // 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())) {
+ } else if (entity instanceof DescriptionElementBase) {
+ // 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 (element == null) {
+ if (element == null) {
AbstractUtility.errorDialog("No element for entity", this,
"Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
- + entity, null);
-
- }
+ + entity, null);
+ }
else if (backgroundColor != null && !backgroundColor.isDisposed()) {
- element.setPersistentBackground(backgroundColor);
- }
+ element.setPersistentBackground(backgroundColor);
+ adapt(element);
+ parentElement.addElement(element);
+ }
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ return element;
+ }
- /**
- * <p>
- * Creates a selection element for the given type T.
- * </p>
- * <p>
- * <strong>Selection elements not handled by this method:</strong>
- * <ul>
+ public void createNamedAreaFieldController(AbstractFormSection parentElement, NamedArea namedArea, SelectionListener removeListener){
+// Object entity = HibernateProxyHelper.deproxy(versionableEntity); TODO deproxy necessary??
+ NamedAreaFieldController element = new NamedAreaFieldController(this, parentElement, namedArea, removeListener, SWT.NONE);
+ adapt(element);
+ parentElement.addElement(element);
+ }
+
+ /**
+ * <p>
+ * Creates a selection element for the given type T.
+ * </p>
+ * <p>
+ * <strong>Selection elements not handled by this method:</strong>
+ * <ul>
* <li>{@link TaxonNodeSelectionElement} see
* {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
* </li>
* <li>{@link NomenclaturalAuthorTeamSelectionElement} see
* {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
* </li>
- * </ul>
- * </p>
- *
- * @param clazz
+ * </ul>
+ * </p>
+ *
+ * @param clazz
* a {@link Class} object of the type that you want the selection
* element to handle
- * @param parentElement
+ * @param parentElement
* a {@link ICdmFormElement} object.
- * @param labelString
- * a {@link String} object.
- * @param selectionType
- * @param selection
- * a {@link ICdmBase} object.
- * @param style
- * a int.
- * @param conversation
- * a {@link ConversationHolder} object.
+ * @param labelString
+ * a {@link String} object.
+ * @param selectionType
+ * @param selection
+ * a {@link ICdmBase} object.
+ * @param style
+ * a int.
+ * @param conversation
+ * a {@link ConversationHolder} object.
* @return a {@link EntitySelectionElement} object.
- */
+ */
public <T extends ICdmBase> EntitySelectionElement<T> createSelectionElement(Class<T> clazz,
ConversationHolder conversation, ICdmFormElement parentElement, String labelString, T selection, int mode,
int style) {
EntitySelectionElement<T> element = new EntitySelectionElement<T>(this, conversation, parentElement, clazz,
labelString, selection, mode, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
-
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
public TaxonNodeSelectionElement createTaxonNodeSelectionElement(ConversationHolder conversation,
ICdmFormElement parentElement, String labelString, TaxonNode selection, int mode, int style) {
TaxonNodeSelectionElement element = new TaxonNodeSelectionElement(this, conversation, parentElement,
labelString, selection, mode, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
-
- public NomenclaturalAuthorTeamSelectionElement createNomenclaturalAuthorTeamSelectionElement(
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
+ public NomenclaturalAuthorTeamSelectionElement createNomenclaturalAuthorTeamSelectionElement(
ConversationHolder conversation, ICdmFormElement parentElement, String labelString, Team selection,
int mode, int style) {
NomenclaturalAuthorTeamSelectionElement element = new NomenclaturalAuthorTeamSelectionElement(this,
conversation, parentElement, labelString, selection, mode, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
-
-
- /** {@inheritDoc} */
- public LabelElement createLabel(ICdmFormElement parentElement, String text) {
- LabelElement labelElement = new LabelElement(this, parentElement, text);
- adapt(labelElement);
- parentElement.addElement(labelElement);
- return labelElement;
- }
-
- /**
- * <p>
- * Getter for the field <code>selectionProvider</code>.
- * </p>
- *
- * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
- */
- public ISelectionProvider getSelectionProvider() {
- return selectionProvider;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createDetailedDescriptionDetailElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param entity
- * a
- * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
- * object.
- * @param style
- * a int.
- * @return a
- * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
- * object.
- */
- public AbstractDetailedDescriptionDetailElement createDetailedDescriptionDetailElement(
+ /** {@inheritDoc} */
+ public LabelElement createLabel(ICdmFormElement parentElement, String text) {
+ LabelElement labelElement = new LabelElement(this, parentElement, text);
+ adapt(labelElement);
+ parentElement.addElement(labelElement);
+ return labelElement;
+ }
+
+ /**
+ * <p>
+ * Getter for the field <code>selectionProvider</code>.
+ * </p>
+ *
+ * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
+ */
+ public ISelectionProvider getSelectionProvider() {
+ return selectionProvider;
+ }
+
+ /**
+ * <p>
+ * createDetailedDescriptionDetailElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param entity
+ * a
+ * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
+ * object.
+ * @param style
+ * a int.
+ * @return a
+ * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
+ * object.
+ */
+ public AbstractDetailedDescriptionDetailElement createDetailedDescriptionDetailElement(
ICdmFormElement parentElement, DescriptionElementBase entity, int style) {
- AbstractDetailedDescriptionDetailElement detailedDescriptionElement = null;
+ AbstractDetailedDescriptionDetailElement detailedDescriptionElement = null;
- if (entity instanceof CategoricalData) {
+ if (entity instanceof CategoricalData) {
detailedDescriptionElement = new CategoricalDataDetailElement(this, parentElement,
(CategoricalData) entity, style);
- } else if (entity instanceof CommonTaxonName) {
+ } else if (entity instanceof CommonTaxonName) {
detailedDescriptionElement = new CommonNameDetailElement(this, parentElement, (CommonTaxonName) entity,
style);
- } else if (entity instanceof Distribution) {
+ } else if (entity instanceof Distribution) {
detailedDescriptionElement = new DistributionDetailElement(this, parentElement, (Distribution) entity,
style);
- } else if (entity instanceof IndividualsAssociation) {
+ } else if (entity instanceof IndividualsAssociation) {
detailedDescriptionElement = new IndividualsAssociationDetailElement(this, parentElement,
(IndividualsAssociation) entity, style);
- } else if (entity instanceof QuantitativeData) {
+ } else if (entity instanceof QuantitativeData) {
detailedDescriptionElement = new QuantitativeDataDetailElement(this, parentElement,
(QuantitativeData) entity, style);
- } else if (entity instanceof TaxonInteraction) {
+ } else if (entity instanceof TaxonInteraction) {
detailedDescriptionElement = new TaxonInteractionDetailElement(this, parentElement,
(TaxonInteraction) entity, style);
- } else if (entity instanceof TextData) {
+ } 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);
- parentElement.addElement(detailedDescriptionElement);
- return detailedDescriptionElement;
-
- }
-
- /**
- * Creates a styled text as a part of the form.
- *
- * @param parent
- * the text parent
- * @param value
- * the text initial value
- * @param style
- * the text style
- * @return the text widget
- */
- public StyledText createStyledText(Composite parent, String value, int style) {
+ }
+ adapt(detailedDescriptionElement);
+ parentElement.addElement(detailedDescriptionElement);
+ return detailedDescriptionElement;
+
+ }
+
+ /**
+ * Creates a styled text as a part of the form.
+ *
+ * @param parent
+ * the text parent
+ * @param value
+ * the text initial value
+ * @param style
+ * the text style
+ * @return the text widget
+ */
+ public StyledText createStyledText(Composite parent, String value, int style) {
StyledText text = new StyledText(parent, getBorderStyle() | style | getOrientation());
if (value != null) {
- text.setText(value);
+ text.setText(value);
}
- text.setForeground(getColors().getForeground());
- text.setBackground(getColors().getBackground());
- // text.addFocusListener(visibilityHandler);
- return text;
- }
+ text.setForeground(getColors().getForeground());
+ text.setBackground(getColors().getBackground());
+ // text.addFocusListener(visibilityHandler);
+ return text;
+ }
+
+
+
+ /**
+ * @param conversationHolder
+ * @param parent
+ * @param detailsViewer
+ * @param i
+ * @return
+ */
+ public FieldObservationGeneralSection createFieldObservationGeneralSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+ FieldObservationGeneralSection section = new FieldObservationGeneralSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+ /**
+ * @param conversationHolder
+ * @param parent
+ * @param detailsViewer
+ * @param i
+ * @return
+ */
+ public GatheringEventSection createGatheringEventSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+ GatheringEventSection section = new GatheringEventSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+ /**
+ * @param conversationHolder
+ * @param parent
+ * @param detailsViewer
+ * @param i
+ * @return
+ */
+ public FieldObservationDetailsSection createFieldObservationDetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+ FieldObservationDetailsSection section = new FieldObservationDetailsSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
+ public SpecimenGeneralSection createSpecimenSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+ SpecimenGeneralSection section = new SpecimenGeneralSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
+ public SpecimenDetailsSection createSpecimenDetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+ SpecimenDetailsSection section = new SpecimenDetailsSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
+ public DerivedUnitDetailsSection createDerivedUnitDetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+ DerivedUnitDetailsSection section = new DerivedUnitDetailsSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
+ public FieldObservationGeneralElementController createSpecimenGeneralElementController(ICdmFormElement parentElement){
+ return createFieldObservationGeneralElementController_internal(parentElement, true, false);
+ }
+
+ public SpecimenDetailsElementController createSpecimenDetailsElementController(ICdmFormElement parentElement){
+ SpecimenDetailsElement element = new SpecimenDetailsElement(parentElement.getLayoutComposite(), SWT.NONE);
+ element.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
+ SpecimenDetailsElementController controller = new SpecimenDetailsElementController(element, this, parentElement);
+ addAndAdaptElement(parentElement, controller);
+ return controller;
+ }
+
+ public DerivedUnitDetailsElementController createDerivedUnitDetailsElementController(ICdmFormElement parentElement){
+ DerivedUnitDetailsElement element = new DerivedUnitDetailsElement(parentElement.getLayoutComposite(), SWT.NONE);
+ element.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
+ DerivedUnitDetailsElementController controller = new DerivedUnitDetailsElementController(element, this, parentElement);
+ addAndAdaptElement(parentElement, controller);
+ return controller;
+ }
+
+ public FieldObservationGeneralElementController createSpecimenGeneralElementControllerWizard(ICdmFormElement parentElement){
+ return createFieldObservationGeneralElementController_internal(parentElement, true, true);
+ }
+ public FieldObservationGeneralElementController createFieldObservationGeneralElementControllerWizard(ICdmFormElement parentElement){
+ return createFieldObservationGeneralElementController_internal(parentElement, false, true);
+ }
+ public FieldObservationGeneralElementController createFieldObservationGeneralElementController(ICdmFormElement parentElement){
+ return createFieldObservationGeneralElementController_internal(parentElement, false, false);
+ }
+ private FieldObservationGeneralElementController createFieldObservationGeneralElementController_internal(ICdmFormElement parentElement, boolean isSpecimen, boolean isWizard){
+ FieldObservationGeneralElement element = new FieldObservationGeneralElement(parentElement.getLayoutComposite(), SWT.NONE);
+ element.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
+ FieldObservationGeneralElementController controller = new FieldObservationGeneralElementController(element, this, parentElement, isSpecimen, isWizard);
+ addAndAdaptElement(parentElement, controller);
+ return controller;
+ }
+ public GatheringEventDetailsElementController createGatheringEventDetailsElementController(ICdmFormElement parentElement) {
+ GatheringEventDetailsElement element = new GatheringEventDetailsElement(parentElement.getLayoutComposite(), SWT.NONE);
+ element.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
+ GatheringEventDetailsElementController controller = new GatheringEventDetailsElementController(element, this, parentElement);
+ adapt(controller);
+ parentElement.addElement(controller);
+ return controller;
+ }
+ public FieldObservationDetailsElementController createFieldObservationDetailsElementController(ICdmFormElement parentElement) {
+ FieldObservationDetailsElement element = new FieldObservationDetailsElement(parentElement.getLayoutComposite(), SWT.NONE);
+ element.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
+ FieldObservationDetailsElementController controller = new FieldObservationDetailsElementController(element, this, parentElement);
+ addAndAdaptElement(parentElement, controller);
+ return controller;
+ }
}
import org.eclipse.swt.widgets.Label;
import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>CheckboxElement class.</p>
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.model.common.TimePeriod;
import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>
import org.eclipse.ui.forms.widgets.Section;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>
package eu.etaxonomy.taxeditor.ui.element;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
import eu.etaxonomy.cdm.common.UriUtils;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>ImageElement class.</p>
import org.eclipse.jface.util.PropertyChangeEvent;
import eu.etaxonomy.cdm.model.description.KeyStatement;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* @author n.hoffmann
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.forms.widgets.TableWrapData;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+
/**
* <p>KeyValueViewerElement class.</p>
import org.eclipse.swt.widgets.Label;
import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>LabelElement class.</p>
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>LanguageStringWithLabelElement class.</p>
// $Id$
/**
* Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
+ * 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.
*/
import org.eclipse.jface.util.PropertyChangeEvent;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>
* MinMaxTextSection class.
* </p>
- *
+ *
* @author c.mathew
* @created 23 Jul 2013
* @version 1.0
private final NumberWithLabelElement text_minVal;
private final NumberWithLabelElement text_maxVal;
private int cursorPosition;
-
+
// unit types handled by this section
public enum UnitType {
ELEVATION,
* <p>
* Constructor for DateDetailSection.
* </p>
- *
+ *
* @param formFactory
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
* object.
text_minVal = formFactory.createNumberTextWithLabelElement(this,
"Min : ", getMinimum(), style);
-
+
text_maxVal = formFactory.createNumberTextWithLabelElement(this,
"Max : ", getMaximum(), style);
-
+
text_freeText = formFactory.createTextWithLabelElement(this,
"Freetext : ", getFreetext(), style);
* <p>
* Setter for the field <code>timePeriod</code>.
* </p>
- *
+ *
* @param timePeriod
* a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
*/
if(getEntity().getDistanceToGroundText() != null) {
text_freeText.setText(getEntity().getDistanceToGroundText());
}
- break;
+ break;
case DIST_TO_WATER:
if(getEntity().getDistanceToWaterSurface() != null) {
text_minVal.setNumber(getEntity().getDistanceToWaterSurface());
if(getEntity().getDistanceToWaterSurfaceText() != null) {
text_freeText.setText(getEntity().getDistanceToWaterSurfaceText());
}
- break;
+ break;
default:
break;
}
}
private void handleEvent(Object eventSource) {
- if (eventSource == text_minVal) {
+ if (eventSource == text_minVal) {
updateMinimum();
} else if (eventSource == text_maxVal) {
updateMaximum();
} else if (eventSource == text_freeText) {
- updateFreetext();
- }
+ updateFreetext();
+ }
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
}
-
+
/*
* (non-Javadoc)
- *
+ *
* @see eu.etaxonomy.taxeditor.forms.AbstractFormSection#dispose()
*/
/** {@inheritDoc} */
formFactory.removePropertyChangeListener(this);
super.dispose();
}
-
+
private void updateMinimum() {
switch(unitType) {
case ELEVATION:
break;
case DIST_TO_GROUND:
getEntity().setDistanceToGround(text_minVal.getDouble());
- break;
+ break;
case DIST_TO_WATER:
getEntity().setDistanceToWaterSurface(text_minVal.getDouble());
- break;
+ break;
}
}
-
+
private Number getMinimum() {
if(getEntity() == null) {
return null;
}
switch(unitType) {
case ELEVATION:
- return getEntity().getAbsoluteElevation();
+ return getEntity().getAbsoluteElevation();
case DIST_TO_GROUND:
- return getEntity().getDistanceToGround();
+ return getEntity().getDistanceToGround();
case DIST_TO_WATER:
- return getEntity().getDistanceToWaterSurface();
+ return getEntity().getDistanceToWaterSurface();
}
return null;
}
-
+
private void updateMaximum() {
switch(unitType) {
case ELEVATION:
break;
case DIST_TO_GROUND:
getEntity().setDistanceToGroundMax(text_maxVal.getDouble());
- break;
+ break;
case DIST_TO_WATER:
getEntity().setDistanceToWaterSurfaceMax(text_maxVal.getDouble());
- break;
+ break;
}
}
-
+
private Number getMaximum() {
if(getEntity() == null) {
return null;
}
switch(unitType) {
case ELEVATION:
- return getEntity().getAbsoluteElevationMaximum();
+ return getEntity().getAbsoluteElevationMaximum();
case DIST_TO_GROUND:
- return getEntity().getDistanceToGroundMax();
+ return getEntity().getDistanceToGroundMax();
case DIST_TO_WATER:
- return getEntity().getDistanceToWaterSurfaceMax();
+ return getEntity().getDistanceToWaterSurfaceMax();
}
return null;
}
-
+
private void updateFreetext() {
switch(unitType) {
case ELEVATION:
break;
case DIST_TO_GROUND:
getEntity().setDistanceToGroundText(text_freeText.getText());
- break;
+ break;
case DIST_TO_WATER:
getEntity().setDistanceToWaterSurfaceText(text_freeText.getText());
- break;
+ break;
}
- }
-
+ }
+
private String getFreetext() {
if(getEntity() == null) {
return null;
}
switch(unitType) {
case ELEVATION:
- return getEntity().getAbsoluteElevationText();
+ return getEntity().getAbsoluteElevationText();
case DIST_TO_GROUND:
- return getEntity().getDistanceToGroundText();
+ return getEntity().getDistanceToGroundText();
case DIST_TO_WATER:
- return getEntity().getDistanceToWaterSurfaceText();
+ return getEntity().getDistanceToWaterSurfaceText();
}
return null;
}
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.translation.TranslationWizard;
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
import org.eclipse.swt.widgets.Display;
import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
private Float start;
private Float end;
-
+
private NumberFormatException exception;
/**
super(toolkit, parentElement, labelString, null, null, style);
setNumber(initialNumber);
}
-
-
+
+
/**
* <p>setNumber</p>
*
public void setNumber(Number number) {
super.setText(getStringRepresentation(number));
}
-
+
/**
* <p>getInteger</p>
*
String text = super.getText().trim();
return text.equals("") ? 0 : new Integer(text);
}
-
+
/**
* <p>getFloat</p>
*
String text = super.getText();
return new Float(text);
}
-
+
/**
* <p>getDouble</p>
*
private String getStringRepresentation(Object number){
if(number != null){
return number.toString();
- }
+ }
return null;
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
text.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
return;
}
-
+
try{
-
+
Float number = Float.parseFloat(value);
-
+
if((start != null && number < start) || (end != null && number > end)){
throw new NumberFormatException("You entered a number that is not within the allowed bounds.");
}
-
+
}catch(NumberFormatException e){
text.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
exception = e;
return;
}
-
+
exception = null;
text.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
-
+
super.modifyText(event);
}
-
+
/**
* <p>setLimits</p>
*
public void setLimits(int numberOfDigits, Integer start, Integer end){
setLimits(numberOfDigits, start.floatValue(), end.floatValue());
}
-
+
/**
* <p>setLimits</p>
*
this.start = start;
this.end = end;
}
-
+
/**
* <p>Getter for the field <code>exception</code>.</p>
*
import org.joda.time.Partial;
import eu.etaxonomy.cdm.model.common.TimePeriod;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>PartialElement class.</p>
import eu.etaxonomy.cdm.model.location.Point;
import eu.etaxonomy.cdm.model.location.ReferenceSystem;
import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
/**
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Composite;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+
/**
* <p>RootElement class.</p>
import org.eclipse.swt.widgets.Widget;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
import org.eclipse.swt.widgets.Text;
import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>TextActionElement class.</p>
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>
import org.eclipse.ui.forms.widgets.Section;
import eu.etaxonomy.cdm.model.common.TimePeriod;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>
import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* When the button is pressed, this textfield may be edited.
import java.net.URI;
import java.net.URISyntaxException;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+
/**
* @author n.hoffmann
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
/**
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
/**
import eu.etaxonomy.cdm.api.service.IUserService;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
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.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
-import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
/**
* <p>
* @created Feb 26, 2010
* @version 1.0
*/
-public abstract class AbstractCdmDetailElement<T> extends AbstractCdmFormElement implements IEntityElement<T>, IEnableableFormElement, IConversationEnabled {
+public abstract class AbstractCdmDetailElement<T> extends AbstractCdmFormElement implements ICdmDetailElement<T> {
private T entity;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
*/
public abstract class AbstractCdmDetailSection<ENTITY> extends AbstractFormSection<ENTITY> implements IEnableableFormElement, IExpansionListener {
- private AbstractCdmDetailElement<ENTITY> detailElement;
+ protected ICdmDetailElement<ENTITY> detailElement;
/**
* <p>
createControlsByType(formElement, null, style);
}
- protected abstract AbstractCdmDetailElement<ENTITY> createCdmDetailElement(AbstractCdmDetailSection<ENTITY> parentElement, int style);
+ protected abstract ICdmDetailElement<ENTITY> createCdmDetailElement(AbstractCdmDetailSection<ENTITY> parentElement, int style);
- protected AbstractCdmDetailElement<ENTITY> createCdmDetailElementByType(AbstractCdmDetailSection<ENTITY> parentElement, Class<ENTITY> entityClass, int style){
+ protected ICdmDetailElement<ENTITY> createCdmDetailElementByType(AbstractCdmDetailSection<ENTITY> parentElement, Class<ENTITY> entityClass, int style){
return createCdmDetailElement(parentElement, style);
}
// $Id$
/**
* Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
+ * 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.
*/
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.ImageResources;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
import eu.etaxonomy.taxeditor.ui.element.ISelectable;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
* <p>
* Abstract AbstractEntityCollectionElement class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Nov 16, 2009
* @version 1.0
protected ENTITY entity;
- private Composite container;
+ private final Composite container;
- private Composite box;
+ private final Composite box;
private Button button_remove;
* <p>
* Constructor for AbstractEntityCollectionElement.
* </p>
- *
+ *
* @param style
* a int.
* @param formFactory
/**
* Init gets executed before any other setup of the section takes place
- *
+ *
* Implement this if you want to configure the section
*/
public void init() {
* <p>
* Setter for the field <code>entity</code>.
* </p>
- *
+ *
* @param entity
* a ENTITY object.
*/
* <p>
* Getter for the field <code>entity</code>.
* </p>
- *
+ *
* @return a ENTITY object.
*/
- public ENTITY getEntity() {
+ @Override
+ public ENTITY getEntity() {
return entity;
}
* <p>
* createControls
* </p>
- *
+ *
* @param element
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
/**
* Mark <code>this</code> element as selected.
*/
- public void setSelected(boolean selected) {
+ @Override
+ public void setSelected(boolean selected) {
for (ICdmFormElement element : getElements()) {
if (element instanceof ISelectable) {
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#propertyChange(org
* .eclipse.jface.util.PropertyChangeEvent)
* <p>
* handleEvent
* </p>
- *
+ *
* @param eventSource
* a {@link java.lang.Object} object.
*/
public abstract void handleEvent(Object eventSource);
/** {@inheritDoc} */
- public void setBackground(Color color) {
+ @Override
+ public void setBackground(Color color) {
backgroundColor = color;
super.setBackground(color);
box.setBackground(color);
/**
* {@inheritDoc}
- *
+ *
* React when selection occurs
*/
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
}
/** {@inheritDoc} */
- public void widgetDefaultSelected(SelectionEvent e) {
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
}
/** {@inheritDoc} */
* <p>
* Getter for the field <code>backgroundColor</code>.
* </p>
- *
+ *
* @return the backgroundColor
*/
public Color getBackgroundColor() {
* <p>
* getConversationHolder
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
* object.
*/
- public ConversationHolder getConversationHolder() {
+ @Override
+ public ConversationHolder getConversationHolder() {
if (getParentElement() instanceof IConversationEnabled) {
return ((IConversationEnabled) getParentElement())
.getConversationHolder();
}
/** {@inheritDoc} */
- public void update(CdmDataChangeMap changeEvents) {
+ @Override
+ public void update(CdmDataChangeMap changeEvents) {
}
}
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
* This class visualizes an CDM entity of type ENTITY and additionally provides the functionality to add
return PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOULD_EXPAND_SECTION_WHEN_DATA_AVAILABLE);
}
+ /**
+ * Remove an element from the entities collection and update the section
+ *
+ * @param element a ELEMENT object.
+ */
+ public void removeElementAndUpdate(ELEMENT element) {
+ removeElement(element);
+ internalUpdateSection(true);
+ }
+
/**
* Get the specific collection of this entity
*
import java.util.Arrays;
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
/**
import org.eclipse.swt.widgets.Label;
import eu.etaxonomy.cdm.model.common.VersionableEntity;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
* <p>EmptyElement class.</p>
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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;
+
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
+import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
+
+/**
+ * @author pplitzner
+ * @date 30.07.2013
+ *
+ */
+public interface ICdmDetailElement<T> extends IEntityElement<T>, IEnableableFormElement, IConversationEnabled{
+
+ public abstract void setEntity(T entity);
+
+}
package eu.etaxonomy.taxeditor.ui.section.agent;
import eu.etaxonomy.cdm.model.agent.Institution;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.agent.Institution;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.agent.Institution;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
import org.eclipse.swt.SWT;
import eu.etaxonomy.cdm.model.agent.Person;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.agent.Person;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.agent.Person;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.model.agent.Person;
import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.agent.Person;
import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.model.agent.Team;
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
* <p>
// $Id$
/**
* Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
+ * 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.
*/
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.parser.ParseHandler;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
* <p>
* TaxonNodeDetailElement class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Sep 27, 2010
* @version 1.0
* <p>
* Constructor for TaxonNodeDetailElement.
* </p>
- *
+ *
* @param formFactory
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
* object.
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
* (eu.etaxonomy.taxeditor.forms.ICdmFormElement,
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
* .lang.Object)
* <p>
* Getter for the field <code>classification</code>.
* </p>
- *
+ *
* @return the classification
*/
public Classification getClassification() {
* <p>
* isOpenInEditor
* </p>
- *
+ *
* @return the openInEditor
*/
public boolean isOpenInEditor() {
* <p>
* Getter for the field <code>parentTreeNode</code>.
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
*/
public ITaxonTreeNode getParentTreeNode() {
* <p>
* Getter for the field <code>taxon</code>.
* </p>
- *
+ *
* @return the taxon
*/
public Taxon getTaxon() {
selection_parentTaxonNode.setEntity((TaxonNode) parentTreeNode);
selection_parentTaxonNode.setClassification(classification);
} else if(parentTreeNode == null){
- this.parentTreeNode = selection_classification.getEntity();
+ this.parentTreeNode = selection_classification.getEntity();
}
}
* <p>
* isComplete
* </p>
- *
+ *
* @return the complete
*/
public boolean isComplete() {
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
* <p>
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.dialog.selection.DerivedUnitSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.FeatureTree;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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;
package eu.etaxonomy.taxeditor.ui.section.description;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
import eu.etaxonomy.cdm.model.description.TextData;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.description.operation.ChangeDescriptionElementType;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractOriginalSourceElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import java.util.Collection;
-
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.common.IdentifiableSource;
import eu.etaxonomy.cdm.model.common.OriginalSourceType;
-import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
-import eu.etaxonomy.taxeditor.ui.dialog.selection.OriginalSourceTypeSelectionDialog;
+import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
import eu.etaxonomy.cdm.model.common.OriginalSourceType;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.dialog.selection.OriginalSourceTypeSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
/**
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.media.MediaElement;
import org.eclipse.swt.events.SelectionListener;
-
import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
/**
import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.description.IModifiable;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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 org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
/**
import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.model.description.State;
import eu.etaxonomy.cdm.model.description.StateData;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
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.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.CategoricalData;
import eu.etaxonomy.cdm.model.description.StateData;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
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.element.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.QuantitativeData;
import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.description.detail;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
* @version 1.0
*/
public abstract class AbstractDetailedDescriptionDetailElement<T extends DescriptionElementBase> extends AbstractCdmDetailElement<T>{
-
+
/**
* <p>Constructor for AbstractDetailedDescriptionDetailElement.</p>
*
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import eu.etaxonomy.cdm.model.description.CategoricalData;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.section.description.StateDataSection;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.description.CommonTaxonName;
import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.model.description.Distribution;
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.model.description.MeasurementUnit;
import eu.etaxonomy.cdm.model.description.QuantitativeData;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
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.description.StatisticalMeasurementValueSection;
import eu.etaxonomy.cdm.model.description.TaxonInteraction;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import org.eclipse.swt.SWT;
import eu.etaxonomy.cdm.model.description.TextData;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement;
/**
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.BrowserElement;
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;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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;
package eu.etaxonomy.taxeditor.ui.section.grantedAuthority;
import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
-import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
package eu.etaxonomy.taxeditor.ui.section.grantedAuthority;
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.Group;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.dialog.selection.GrantedAuthoritySelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
package eu.etaxonomy.taxeditor.ui.section.group;
import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.Group;
import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.dialog.selection.UserSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.IIdentificationKey;
import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import org.eclipse.swt.SWT;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
/**
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.model.description.PolytomousKey;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.KeyStatementElement;
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonBaseSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.common.media.ImageInfo;
import eu.etaxonomy.cdm.model.media.ImageFile;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.ImageElement;
import eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement;
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
import eu.etaxonomy.cdm.model.media.MediaRepresentation;
import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
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.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LabelElement;
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.cdm.model.media.ImageFile;
import eu.etaxonomy.cdm.model.media.MediaRepresentation;
import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.media.MediaRepresentation;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import java.util.Collection;
-
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity;
import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractReferencedEntityElement;
/**
import java.util.Arrays;
import eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor;
-import eu.etaxonomy.cdm.model.agent.Team;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.taxeditor.model.AuthorHelper;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.ITaxonBaseDetailSection;
package eu.etaxonomy.taxeditor.ui.section.name;
import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.ITaxonBaseDetailSection;
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
import java.util.Arrays;
+import org.apache.log4j.Logger;
import org.eclipse.swt.SWT;
import eu.etaxonomy.cdm.model.name.BotanicalName;
import eu.etaxonomy.cdm.model.name.Rank;
import eu.etaxonomy.cdm.model.name.ZoologicalName;
import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
*/
public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<NonViralName> implements ISelectableElement, IEnableableFormElement{
+ private final Logger logger = Logger.getLogger(NameDetailElement.class);
+
private TermComboElement<Rank> combo_rank;
private TextWithLabelElement text_appendedPhrase;
private TextWithLabelElement text_uninomial;
private NumberWithLabelElement text_publicationYear;
private NumberWithLabelElement text_originalPublicationYear;
private int cursorPosition;
-
+
/**
* <p>Constructor for NameDetailElement.</p>
*
/** {@inheritDoc} */
@Override
protected void createControls(ICdmFormElement formElement, NonViralName nonViralName, int style) {
-
+
toggleable_cache = formFactory.createToggleableTextField(this, "Name Cache", nonViralName.getNameCache(), nonViralName.isProtectedNameCache(), style);
-
+
combo_rank = formFactory.createTermComboElement(Rank.class, this, "Rank", nonViralName.getRank(), style);
-
+
createGenusOrUninomialControls(this, nonViralName, style);
createInfragenerericEpithetControls(this, nonViralName, style);
createSpecificEpithetControls(this, nonViralName, style);
createInfraSpecificEpithetControls(this, nonViralName, style);
-
+
createSpecificNameParts(this, nonViralName, style);
-
+
text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style);
-
+
}
/**
protected void clearCheckRankWarnings() {
if(getEntity().hasProblem(ParserProblem.CheckRank)){
getEntity().removeParsingProblem(ParserProblem.CheckRank);
-
+
// FIXME this has to be reafctored completely. See tickets #1959, #1663, #1957, #1958
// TaxonNameEditor nameEditor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(Page.NAME);
// nameEditor.getSelectedContainer().getNameViewer().clearErrors();
}
}
-
+
/** {@inheritDoc} */
@Override
protected void updateContent() {
if(getEntity() == null){
setEntity(NonViralName.NewInstance(null));
}
-
+
super.updateContent();
-
+
if(isIrrelevant()){
setIrrelevant(isIrrelevant());
}else{
case ICZN:
createZoologicalNameParts(formElement, nonViralName, style);
break;
+ case ICVCN:
+ //TODO implement
+ logger.warn("ICVCN not yet implemented");
+ break;
+ case ICNB:
+ //TODO implement
+ logger.warn("ICNB not yet implemented");
+ break;
+ case ICNCP:
+ //TODO implement
+ logger.warn("ICNCP not yet implemented");
+ break;
}
}
}
-
+
private void createBotanicalNameParts(ICdmFormElement formElement, NonViralName nonViralName, int style){
BotanicalName botanicalName = (BotanicalName) nonViralName;
checkbox_anamorphic = formFactory.createCheckbox(formElement, "Anamorphic", botanicalName.isAnamorphic(), style);
text_publicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Publication Year", zoologicalName.getPublicationYear(), style);
text_originalPublicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Orig. Publication Year", zoologicalName.getOriginalPublicationYear(), style);
}
-
- private void createGenusOrUninomialControls(ICdmFormElement element, NonViralName nonViralName, int style){
+
+ private void createGenusOrUninomialControls(ICdmFormElement element, NonViralName nonViralName, int style){
String title = "Genus";
Rank rank = nonViralName.getRank();
if(rank != null && rank.isSupraGeneric()){
- title = "Uninomial";
+ title = "Uninomial";
}
text_uninomial = formFactory.createTextWithLabelElement(element, title, nonViralName.getGenusOrUninomial(), style);
}
-
+
private void createInfragenerericEpithetControls(ICdmFormElement element, NonViralName nonViralName, int style){
if(nonViralName.getRank() != null && nonViralName.getRank().isInfraGeneric() && !nonViralName.getRank().isSpeciesAggregate()){
text_infragenericEpithet = formFactory.createTextWithLabelElement(element, "Infrageneric Epithet", nonViralName.getInfraGenericEpithet(), style);
}
}
-
+
private void createSpecificEpithetControls(ICdmFormElement element, NonViralName nonViralName, int style){
if(nonViralName.getRank() != null && (nonViralName.getRank().isSpecies() || nonViralName.getRank().isInfraSpecific() || nonViralName.getRank().isSpeciesAggregate())){
text_specificEpithet = formFactory.createTextWithLabelElement(element, "Specific Epithet", nonViralName.getSpecificEpithet(), SWT.NULL);
}
}
-
+
private void createInfraSpecificEpithetControls(ICdmFormElement element, NonViralName nonViralName, int style){
if(nonViralName.getRank() != null && nonViralName.getRank().isInfraSpecific()){
text_infraspecificEpithet = formFactory.createTextWithLabelElement(element, "Infraspecific Epithet", nonViralName.getInfraSpecificEpithet(), SWT.NULL);
}
}
-
+
/** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource){
if (eventSource == toggleable_cache) {
getEntity().setNameCache(toggleable_cache.getText(),
toggleable_cache.getState());
- if (!isIrrelevant())
- setIrrelevant(toggleable_cache.getState(),
+ if (!isIrrelevant()) {
+ setIrrelevant(toggleable_cache.getState(),
Arrays.asList(new Object[] { toggleable_cache }));
+ }
}
else if(eventSource == combo_rank){
getEntity().setRank(combo_rank.getSelection());
clearCheckRankWarnings();
updateContent();
- }
+ }
else if(eventSource == text_appendedPhrase){
getEntity().setAppendedPhrase(text_appendedPhrase.getText());
}
}
else if(eventSource == text_uninomial){
getEntity().setGenusOrUninomial(text_uninomial.getText());
- }
+ }
else if(eventSource == checkbox_anamorphic){
((BotanicalName)getEntity()).setAnamorphic(checkbox_anamorphic.getSelection());
}
}
-
+
/*
* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.forms.section.cdmdetail.ISelectableElement#getSelectionArbitrator()
*
* @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator} object.
*/
- public SelectionArbitrator getSelectionArbitrator() {
+ @Override
+ public SelectionArbitrator getSelectionArbitrator() {
return selectionArbitrator;
}
-
+
@Override
public void updateToggleableCacheField() {
if(! getEntity().isProtectedNameCache()){
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.ITaxonBaseDetailSection;
import eu.etaxonomy.cdm.model.name.NameRelationship;
import eu.etaxonomy.cdm.model.name.NameRelationshipType;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LabelElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractReferencedEntityElement;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
import eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
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.AbstractCdmDetailSection;
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-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.ITaxonBaseDetailSection;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.common.EventBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
import java.util.Collection;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.dialog.selection.NamedAreaSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
- * <p>CollectingAreasDetailSection class.</p>
+ * <p>
+ * CollectingAreasDetailSection class.
+ * </p>
*
* @author n.hoffmann
* @created Oct 14, 2010
* @version 1.0
*/
-public class CollectingAreasDetailSection extends
- AbstractEntityCollectionSection<DerivedUnitFacade, NamedArea> {
+public class CollectingAreasDetailSection extends AbstractEntityCollectionSection<DerivedUnitFacade, NamedArea> {
/**
* <p>Constructor for CollectingAreasDetailSection.</p>
@Override
public NamedArea createNewElement() {
NamedArea selection = NamedAreaSelectionDialog.select(getLayoutComposite().getShell(), getConversationHolder(), null);
-
+
return selection;
}
return "Add a collecting area";
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createElementComposite(java.lang.Object, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.graphics.Color)
+ */
+ @Override
+ protected void createElementComposite(NamedArea element, SelectionListener removeListener, Color backgroundColor) {
+ formFactory.createNamedAreaFieldController(this, element, removeListener);
+ }
+
}
import eu.etaxonomy.cdm.model.agent.Institution;
import eu.etaxonomy.cdm.model.occurrence.Collection;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.occurrence.Collection;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
import eu.etaxonomy.taxeditor.model.ImageResources;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
* @author n.hoffmann
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
private TextWithLabelElement text_exsicatum;
- //FIXME:3.3MC---- see Ticket #3732
+ //FIXME:3.3MC----
// private TermComboElement<PreservationMethod> combo_preservationMethod;
//FIXME:3.3MC----
text_barcode = formFactory.createTextWithLabelElement(formElement, "Barcode", entity.getBarcode(), style);
text_catalogNumber = formFactory.createTextWithLabelElement(formElement, "Catalog Number", entity.getCatalogNumber(), style);
-
- //FIXME:3.3MC----
+ //FIXME:3.3MC----
// try {
// combo_preservationMethod = formFactory.createTermComboElement(PreservationMethod.class, formElement, "Preservation Method", entity.getPreservationMethod(), style);
// } catch (MethodNotSupportedByDerivedUnitTypeException e) {
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2013 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;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.DerivedUnitDetailsElementController;
+import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+
+/**
+ * @author pplitzner
+ * @date 02.09.2013
+ *
+ */
+public class DerivedUnitDetailsWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
+
+ /**
+ * @param formFactory
+ * @param conversation
+ * @param entity
+ */
+ public DerivedUnitDetailsWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, DerivedUnitFacade entity) {
+ super(formFactory, conversation, entity);
+ setTitle("Derived Unit Details");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.ui.forms.AbstractCdmEntityWizardPage#checkComplete
+ * ()
+ */
+ @Override
+ protected void checkComplete() {
+ setPageComplete(true);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement
+ * (eu.etaxonomy.taxeditor.forms.ICdmFormElement)
+ */
+ @Override
+ public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
+ DerivedUnitDetailsElementController detailElement = formFactory.createDerivedUnitDetailsElementController(rootElement);
+ detailElement.setEntity(getEntity());
+ checkComplete();
+ return detailElement;
+ }
+}
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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 org.eclipse.ui.forms.widgets.ExpandableComposite;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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 org.eclipse.swt.events.SelectionListener;
-
import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
* @author n.hoffmann
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.model.common.DefinedTerm;
-import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsElementController;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
* @created Dec 15, 2010
* @version 1.0
*/
-public class FieldObservationWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
+public class FieldObservationDetailsWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
/**
* @param formFactory
* @param conversation
* @param entity
*/
- public FieldObservationWizardPage(CdmFormFactory formFactory,
+ public FieldObservationDetailsWizardPage(CdmFormFactory formFactory,
ConversationHolder conversation, DerivedUnitFacade entity) {
super(formFactory, conversation, entity);
setTitle("Field Observation Details");
*/
@Override
public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
- FieldObservationDetailElement detailElement = formFactory.createFieldObservationDetailElement(rootElement);
+ FieldObservationDetailsElementController detailElement = formFactory.createFieldObservationDetailsElementController(rootElement);
detailElement.setEntity(getEntity());
return detailElement;
}
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralElementController;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
* @created Dec 17, 2010
* @version 1.0
*/
-public class GeneralWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
+public class FieldObservationGeneralWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
/**
* @param formFactory
* @param conversation
* @param entity
*/
- public GeneralWizardPage(CdmFormFactory formFactory,
+ public FieldObservationGeneralWizardPage(CdmFormFactory formFactory,
ConversationHolder conversation, DerivedUnitFacade entity) {
super(formFactory, conversation, entity);
- setTitle("General Specimen Data");
+ setTitle("Field Observation");
}
/* (non-Javadoc)
*/
@Override
public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
- GeneralDetailElement detailElement = formFactory.createGeneralDetailElement(rootElement);
+ FieldObservationGeneralElementController detailElement = formFactory.createFieldObservationGeneralElementControllerWizard(rootElement);
detailElement.setEntity(getEntity());
checkComplete();
return detailElement;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection;
-import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventDetailsElementController;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
* @created Dec 15, 2010
* @version 1.0
*/
-public class GatheringEventWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
+public class GatheringEventDetailsWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
/**
* @param formFactory
* @param conversation
* @param entity
*/
- public GatheringEventWizardPage(CdmFormFactory formFactory,
+ public GatheringEventDetailsWizardPage(CdmFormFactory formFactory,
ConversationHolder conversation, DerivedUnitFacade entity) {
super(formFactory, conversation, entity);
setTitle("Gathering Event Details");
*/
@Override
public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
- GatheringEventDetailElement detailElement = formFactory.createGatheringEventDetailElement(rootElement);
+ GatheringEventDetailsElementController detailElement = formFactory.createGatheringEventDetailsElementController(rootElement);
detailElement.setEntity(getEntity());
return detailElement;
}
import eu.etaxonomy.cdm.model.location.NamedArea;
import eu.etaxonomy.cdm.model.occurrence.Collection;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.PointElement;
import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
-import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection;
/**
* @author n.hoffmann
private TextWithLabelElement text_collectingNumber;
private EntitySelectionElement<Collection> selection_collection;
private TextWithLabelElement text_accessionNumber;
-
/**
* @param formFactory
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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 org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
import eu.etaxonomy.cdm.model.common.OriginalSourceType;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenDetailsElementController;
+import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+
+/**
+ * @author pplitzner
+ * @date 30.08.2013
+ *
+ */
+public class SpecimenDetailsWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
+
+ /**
+ * @param formFactory
+ * @param conversation
+ * @param entity
+ */
+ public SpecimenDetailsWizardPage(CdmFormFactory formFactory,
+ ConversationHolder conversation, DerivedUnitFacade entity) {
+ super(formFactory, conversation, entity);
+ setTitle("Specimen Details");
+ setPageComplete(true);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.forms.AbstractCdmEntityWizardPage#checkComplete()
+ */
+ @Override
+ protected void checkComplete() {
+ setPageComplete(true);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
+ */
+ @Override
+ public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
+ SpecimenDetailsElementController detailElement = formFactory.createSpecimenDetailsElementController(rootElement);
+ detailElement.setEntity(getEntity());
+ return detailElement;
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralElementController;
+import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+
+/**
+ * @author pplitzner
+ * @date 02.09.2013
+ *
+ */
+public class SpecimenGeneralWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
+
+ /**
+ * @param formFactory
+ * @param conversation
+ * @param entity
+ */
+ public SpecimenGeneralWizardPage(CdmFormFactory formFactory,
+ ConversationHolder conversation, DerivedUnitFacade entity) {
+ super(formFactory, conversation, entity);
+ setTitle("Specimen");
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.forms.AbstractCdmEntityWizardPage#checkComplete()
+ */
+ @Override
+ protected void checkComplete() {
+ setPageComplete(true);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
+ */
+ @Override
+ public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
+ FieldObservationGeneralElementController detailElement = formFactory.createSpecimenGeneralElementControllerWizard(rootElement);
+ detailElement.setEntity(getEntity());
+ checkComplete();
+ return detailElement;
+ }
+}
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.ITaxonBaseDetailSection;
import eu.etaxonomy.cdm.model.reference.ReferenceType;
import eu.etaxonomy.taxeditor.model.AuthorHelper;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IErrorIntolerableElement;
import eu.etaxonomy.taxeditor.ui.element.IExceptionHandler;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.ITaxonBaseDetailSection;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IExceptionHandler;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* 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.
*/
import eu.etaxonomy.cdm.model.common.OriginalSourceBase;
import eu.etaxonomy.cdm.model.common.OriginalSourceType;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
/**
int style) {
super(formFactory, section, element, removeListener, style);
}
-
+
/** {@inheritDoc} */
@Override
public void init() {
super.init();
setHasOriginalNameString(true);
}
-
+
/** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement formElement, int style) {
combo_origsourcetype = formFactory
.createEnumComboElement(OriginalSourceType.class,
- formElement, style);
+ formElement, style);
text_idInSource = formFactory.createTextWithLabelElement(formElement, "Id In Source", null, style);
text_idNamespace = formFactory.createTextWithLabelElement(formElement, "ID Namespace", null, style);
super.createControls(formElement, style);
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.model.common.Annotation;
import eu.etaxonomy.cdm.model.common.AnnotationType;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.cdm.model.common.AnnotationType;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
package eu.etaxonomy.taxeditor.ui.section.supplemental;\r
\r
import eu.etaxonomy.cdm.model.common.CdmBase;\r
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.IEntityElement;\r
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;\r
\r
package eu.etaxonomy.taxeditor.ui.section.supplemental;\r
\r
import eu.etaxonomy.cdm.model.common.CdmBase;\r
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
\r
/**\r
* @author l.morris\r
import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.common.Credit;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import java.util.Collection;
-
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.Credit;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.Extension;
import eu.etaxonomy.cdm.model.common.ExtensionType;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
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.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import java.util.Collection;
-
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.Extension;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.ICdmBase;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
* <p>HeadlineSection class.</p>
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
-import eu.etaxonomy.cdm.model.common.OriginalSourceType;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
* <p>IdentifiableSourceElement class.</p>
import eu.etaxonomy.cdm.model.common.Marker;
import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
/**
import java.util.Collection;
-
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.media.Rights;
import eu.etaxonomy.cdm.model.media.RightsType;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.taxeditor.ui.dialog.selection.DerivedUnitSelectionDialog;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
import eu.etaxonomy.cdm.model.common.OriginalSourceType;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.cdm.model.common.VersionableEntity;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
-import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
/**
* <p>VersionElement class.</p>
package eu.etaxonomy.taxeditor.ui.section.supplemental;
import eu.etaxonomy.cdm.model.common.VersionableEntity;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
* <p>VersionSection class.</p>
import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
* <p>ParsingMessageElement class.</p>
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.ITaxonBaseDetailSection;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.ITaxonBaseDetailSection;
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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 org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.Group;
import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.dialog.selection.GroupSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
/**
import eu.etaxonomy.cdm.model.agent.Person;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
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.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
/**\r
* Copyright (C) 2011 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
* http://www.e-taxonomy.eu\r
-* \r
+*\r
* The contents of this file are subject to the Mozilla Public License Version 1.1\r
* See LICENSE.TXT at the top of this package for the full license terms.\r
*/\r
import java.util.ListIterator;\r
import java.util.Map;\r
import java.util.Set;\r
+\r
import org.apache.log4j.Logger;\r
import org.eclipse.swt.events.SelectionEvent;\r
import org.eclipse.swt.events.SelectionListener;\r
import eu.etaxonomy.taxeditor.editor.UsageTermCollection;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
import eu.etaxonomy.taxeditor.store.TermStore;\r
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
\r
- \r
+\r
/**\r
* The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
*\r
- * @author a.theys \r
+ * @author a.theys\r
* @created mar 13, 2012\r
* @version 1.0\r
*/\r
combo_HumanGroup.addSelectionListener(this);\r
combo_EthnicGroup = formFactory.createTermComboElement(DefinedTerm.class, this, UsageTermCollection.ethnicGroupLabel, null, style);\r
combo_Country = formFactory.createTermComboElement(DefinedTerm.class, this, UsageTermCollection.countryLabel, null, style);\r
- \r
+\r
\r
List<State> termsUseCategory = setUseCategoryComboTerms(TermStore.getTerms(State.class, null, false));\r
combo_UseCategory.setTerms(termsUseCategory);\r
combo_UseCategory.setSelection(stateSelection(UsageTermCollection.useCategoryVocabularyLabel));\r
- \r
+\r
List<State> termsSubCategory = setUseCategoryComboTerms(TermStore.getTerms(State.class, null, false), combo_UseCategory.getSelection());\r
- \r
+\r
if (termsSubCategory != null) {\r
combo_UseSubCategory.setTerms(termsSubCategory);\r
combo_UseSubCategory.setSelection(stateSelection(UsageTermCollection.useSubCategoryVocabularyLabel));\r
else {\r
combo_UseSubCategory.setEnabled(false);\r
}\r
- \r
+\r
List<DefinedTerm> plantPartsToAdd = setModifierComboTerms(TermStore.getTerms(DefinedTerm.class, null, false), UsageTermCollection.plantPartLabel);\r
combo_PlantPart.setTerms(plantPartsToAdd);\r
combo_PlantPart.setSelection(modifierSelection(UsageTermCollection.plantPartLabel));\r
- \r
+\r
List<DefinedTerm> countriesToAdd = setModifierComboTerms(TermStore.getTerms(DefinedTerm.class, null, false), UsageTermCollection.countryLabel);\r
combo_Country.setTerms(countriesToAdd);\r
combo_Country.setSelection(modifierSelection(UsageTermCollection.countryLabel));\r
- \r
+\r
List<DefinedTerm> humanGroupToAdd = setModifierComboTerms(TermStore.getTerms(DefinedTerm.class, null, false), UsageTermCollection.humanGroupLabel);\r
combo_HumanGroup.setTerms(humanGroupToAdd);\r
combo_HumanGroup.setSelection(modifierSelection(UsageTermCollection.humanGroupLabel));\r
- \r
+\r
List<DefinedTerm> ethnicGroupToAdd = setEthnicGroupComboTerms(TermStore.getTerms(DefinedTerm.class, null, false), combo_HumanGroup.getSelection());\r
if (ethnicGroupToAdd != null) {\r
combo_EthnicGroup.setTerms(ethnicGroupToAdd);\r
return null;\r
}\r
return null;\r
- \r
+\r
}\r
- \r
+\r
/**\r
* Returns the selected state\r
* @param comboCategory\r
return statedata.getState();\r
}\r
}\r
- } \r
+ }\r
}\r
}\r
else {\r
return null;\r
}\r
return null;\r
- \r
+\r
}\r
- \r
+\r
/**\r
* This function sets the combo terms (Besides EthnicGroup\r
* @param listOfTerms\r
termsToAdd.add(term);\r
}\r
}\r
- \r
+\r
return termsToAdd;\r
}\r
- \r
+\r
\r
/**\r
* This function sets the Use Category combo term\r
State selectedUseCategory) {\r
List<State> termsToAdd = new ArrayList<State>();\r
if (combo_UseCategory.getSelection() != null) {\r
- \r
+\r
for (State term : listOfTerms) {\r
if ((term.getPartOf() != null) && (term.getPartOf().getTitleCache().equals(selectedUseCategory.getTitleCache()))) {\r
termsToAdd.add(term);\r
else if ((term.getVocabulary() !=null) && (term.getVocabulary().getTitleCache().equals(selectedUseCategory.getTitleCache()))) {\r
termsToAdd.add(term);\r
}\r
- \r
+\r
}\r
}\r
else if (!getEntity().getStateData().isEmpty()) {\r
termsToAdd.add(term);\r
}\r
}\r
- \r
+\r
}\r
}\r
}\r
- \r
+\r
}\r
- \r
+\r
else {\r
return null;\r
}\r
\r
return termsToAdd;\r
}\r
- \r
- \r
+\r
+\r
/**\r
* This function sets the EthnicGroup combo term\r
* @param listOfTerms\r
List<DefinedTerm> termsToAdd = new ArrayList<DefinedTerm>();\r
if (combo_HumanGroup.getSelection() != null) {\r
for (DefinedTerm term : listOfTerms) {\r
- \r
+\r
if ((term.getPartOf() != null) && (term.getPartOf().getTitleCache().equals(selectedHumangroup.getTitleCache()))) {\r
termsToAdd.add(term);\r
}\r
termsToAdd.add(modifier);\r
}\r
}\r
- \r
+\r
}\r
}\r
}\r
} else {\r
return null;\r
}\r
- \r
+\r
return termsToAdd;\r
}\r
\r
- \r
+\r
/** {@inheritDoc} */\r
@Override\r
public void handleEvent(Object eventSource) {\r
if(!useCategoryStateDataCheck.getState().getTitleCache().equals(combo_UseCategory.getSelection().getTitleCache())) {\r
isUseCategoryChanged = true;\r
}\r
- \r
+\r
}\r
}\r
ListIterator<StateData> itrExistingStates = getEntity().getStateData().listIterator();\r
stateData.setState(combo_UseCategory.getSelection());\r
stateData.putModifyingText(CdmStore.getDefaultLanguage(),UsageTermCollection.useCategoryVocabularyLabel);\r
itrExistingStates.add(stateData);\r
- \r
+\r
}\r
} else if (modifyingText.get(CdmStore.getDefaultLanguage()).getText().equals(UsageTermCollection.useSubCategoryVocabularyLabel) && isUseCategoryChanged == true) {\r
itrExistingStates.remove();\r
}\r
}\r
}\r
- \r
- \r
+\r
+\r
if (isChanged == false) {\r
StateData stateData = StateData\r
.NewInstance(combo_UseCategory.getSelection());\r
stateData.putModifyingText(CdmStore.getDefaultLanguage(), UsageTermCollection.useCategoryVocabularyLabel);\r
getEntity().addStateData(stateData);\r
}\r
- \r
+\r
combo_UseSubCategory.setEnabled(true);\r
- \r
+\r
}\r
else {\r
if (!getEntity().getStateData().isEmpty()) {\r
}\r
}\r
}\r
- \r
+\r
if (eventSource == combo_UseSubCategory) {\r
if (combo_UseSubCategory.getSelection() != null) {\r
boolean isChanged = false;\r
}\r
}\r
}\r
- \r
+\r
if (isChanged == false){\r
StateData stateData = StateData\r
.NewInstance(combo_UseSubCategory.getSelection());\r
stateData.putModifyingText(CdmStore.getDefaultLanguage(), UsageTermCollection.useSubCategoryVocabularyLabel);\r
getEntity().addStateData(stateData);\r
}\r
- \r
+\r
} else {\r
if (!getEntity().getStateData().isEmpty()) {\r
Iterator<StateData> itrStateData = getEntity().getStateData().iterator();\r
if(GetVocabularyType(modifier, UsageTermCollection.plantPartLabel)) {\r
itrExistingModifiers.remove();\r
}\r
- \r
- } \r
+\r
+ }\r
DefinedTerm plantPart = combo_PlantPart.getSelection();\r
getEntity().addModifier(plantPart);\r
} else {\r
}\r
}\r
}\r
- \r
+\r
}\r
}\r
if (eventSource == combo_Country) {\r
if(GetVocabularyType(modifier, UsageTermCollection.countryLabel)) {\r
itrExistingModifiers.remove();\r
}\r
- \r
+\r
}\r
DefinedTerm country = combo_Country.getSelection();\r
getEntity().addModifier(country);\r
if(modToCheck.equals(combo_HumanGroup.getSelection()) && (GetVocabularyType(modToCheck, UsageTermCollection.humanGroupLabel))) {\r
isHumanGroupChanged = false;\r
}\r
- \r
- \r
+\r
+\r
}\r
Iterator<DefinedTerm> itrExistingModifiers = getEntity().getModifiers().iterator();\r
while (itrExistingModifiers.hasNext()) {\r
if((GetVocabularyType(modifier, UsageTermCollection.humanGroupLabel) || GetVocabularyType(modifier, UsageTermCollection.ethnicGroupLabel)) && isHumanGroupChanged) {\r
itrExistingModifiers.remove();\r
}\r
- \r
- } \r
+\r
+ }\r
if(isHumanGroupChanged){\r
DefinedTerm humanGroup = combo_HumanGroup.getSelection();\r
getEntity().addModifier(humanGroup);\r
//DefinedTerm emptyMod = DefinedTerm.NewInstance();\r
DefinedTerm emptyMod = null;\r
//FIXME:3.3MC----\r
- \r
- \r
+\r
+\r
emptyListToResetComboBox.add(emptyMod);\r
combo_EthnicGroup.setTerms(emptyListToResetComboBox);\r
combo_EthnicGroup.setEnabled(false);\r
- \r
+\r
}\r
}\r
if (eventSource == combo_EthnicGroup) {\r
if(GetVocabularyType(modifier, combo_HumanGroup.getSelection().getTitleCache())) {\r
itrExistingModifiers.remove();\r
}\r
- \r
- } \r
+\r
+ }\r
DefinedTerm ethnicGroup = combo_EthnicGroup.getSelection();\r
getEntity().addModifier(ethnicGroup);\r
} else {\r
Set<DefinedTerm> modifiers = getEntity().getModifiers();\r
if(!modifiers.isEmpty()) {\r
- \r
+\r
Iterator<DefinedTerm> itr = modifiers.iterator();\r
while (itr.hasNext()) {\r
DefinedTerm currentMod = itr.next();\r
itr.remove();\r
}\r
}\r
- \r
+\r
}\r
}\r
}\r
}\r
- \r
- \r
+\r
+\r
\r
/**\r
* This function Checks the vocabulary type\r
}\r
return false;\r
}\r
- \r
- \r
+\r
+\r
\r
/** {@inheritDoc} */\r
@Override\r
State selectedUseCategory = combo_UseCategory.getSelection();\r
if (selectedUseCategory != null) {\r
combo_UseSubCategory.setTerms(setUseCategoryComboTerms(TermStore.getTerms(State.class, null, false),selectedUseCategory));\r
- \r
+\r
if (!getEntity().getStateData().isEmpty()) {\r
Iterator<StateData> itrExistingState = getEntity().getStateData().iterator();\r
while(itrExistingState.hasNext()) {\r
- StateData existingStateData = (StateData) itrExistingState.next();\r
+ StateData existingStateData = itrExistingState.next();\r
Map<Language, LanguageString> modifyingText = existingStateData.getModifyingText();\r
if (modifyingText.get(CdmStore.getDefaultLanguage()) != null) {\r
if (modifyingText.get(CdmStore.getDefaultLanguage())\r
}\r
}\r
}\r
- \r
+\r
}\r
}\r
}\r
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.taxeditor.editor.definedterm.TermBasePropertyTester;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;\r
import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;\r
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
\r
import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
\r
/**\r
* @author l.morris\r
\r
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
\r
import java.net.URISyntaxException;\r
\r
import eu.etaxonomy.cdm.model.common.Language;\r
-import eu.etaxonomy.cdm.model.common.Representation;\r
import eu.etaxonomy.cdm.model.location.NamedArea;\r
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;\r
import eu.etaxonomy.cdm.model.location.NamedAreaType;\r
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;\r
\r
/**\r
\r
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
import eu.etaxonomy.cdm.model.location.NamedArea;\r
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
\r
\r
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;\r
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
\r
\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.taxeditor.store.StoreUtil;\r
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;\r
\r
/**\r
\r
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
\r
// $Id$
/**
* Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
+ * 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.
*/
import eu.etaxonomy.taxeditor.model.TextHelper;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.IEntitySelectionElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.section.agent.InstitutionWizardPage;
import eu.etaxonomy.taxeditor.ui.section.agent.PersonWizardPage;
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameWizardPage;
import eu.etaxonomy.taxeditor.ui.section.occurrence.CollectionWizardPage;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseWizardPage;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationWizardPage;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventWizardPage;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.GeneralWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationDetailsWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailsWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationGeneralWizardPage;
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceWizardPage;
import eu.etaxonomy.taxeditor.ui.section.user.UserDetailWizardPage;
* <p>
* EditFromSelectionWizard class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Jun 1, 2010
* @version 1.0
public class EditFromSelectionWizard extends Wizard implements
SelectionListener {
- private final EntitySelectionElement selectionElement;
+ private final IEntitySelectionElement selectionElement;
/**
* <p>
* Constructor for EditFromSelectionWizard.
* </p>
- *
+ *
* @param selectionElement
* a
* {@link eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement}
* object.
*/
- public EditFromSelectionWizard(EntitySelectionElement selectionElement) {
+ public EditFromSelectionWizard(IEntitySelectionElement selectionElement) {
this.selectionElement = selectionElement;
this.setWindowTitle(String.format("Edit %s", TextHelper.deproxyClassName(selectionElement.getEntity().getClass())));
}
throw new IllegalStateException();
}
- addPage(new GeneralWizardPage(formFactory,
+ addPage(new FieldObservationGeneralWizardPage(formFactory,
selectionElement.getConversationHolder(), facade));
- addPage(new GatheringEventWizardPage(formFactory,
+ addPage(new GatheringEventDetailsWizardPage(formFactory,
selectionElement.getConversationHolder(), facade));
- addPage(new FieldObservationWizardPage(formFactory,
+ addPage(new FieldObservationDetailsWizardPage(formFactory,
selectionElement.getConversationHolder(), facade));
addPage(new DerivedUnitBaseWizardPage(formFactory,
selectionElement.getConversationHolder(), facade));
selectionElement.getConversationHolder(),
(Institution) entity));
} else if (entity instanceof User) {
- addPage(new UserDetailWizardPage(formFactory,
- selectionElement.getConversationHolder(),
+ addPage(new UserDetailWizardPage(formFactory,
+ selectionElement.getConversationHolder(),
(User) entity));
} else {
StoreUtil.warningDialog("Missing interface", this,
"No detail element for current selection");
- }
+ }
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
/** {@inheritDoc} */
/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.ui.selection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.springframework.security.core.GrantedAuthority;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.model.common.Group;
import eu.etaxonomy.cdm.model.common.ICdmBase;
import eu.etaxonomy.taxeditor.model.ImageResources;
import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.IEntitySelectionElement;
import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
-import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
-import eu.etaxonomy.taxeditor.ui.element.ILabeledElement;
-import eu.etaxonomy.taxeditor.ui.element.ISelectable;
-import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
* <p>
* Abstract AbstractSelectionElement class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Nov 17, 2009
* @version 1.0
* @param <T>
*/
public class EntitySelectionElement<T extends ICdmBase> extends
- AbstractCdmFormElement implements SelectionListener,
- IEnableableFormElement, ISelectableElement, IEntityElement<T>,
- ILabeledElement, IConversationEnabled, ISelectable {
+ AbstractCdmFormElement implements IEntitySelectionElement<T>{
/**
* Bitmask for configuring functionality of selection element
* <p>
* Constructor for AbstractSelectionElement.
* </p>
- *
+ *
* @param formFactory
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
* object.
this.isEditable = (mode & EDITABLE) == EDITABLE;
this.isDeletable = (mode & DELETABLE) == DELETABLE;
boolean isSelectable = (mode & SELECTABLE) == SELECTABLE;
-
+
this.labelString = labelString;
this.conversation = conversation;
setEntity(entity);
}
-
+
public EntitySelectionElement(CdmFormFactory formFactory,
ConversationHolder conversation, ICdmFormElement parentElement, Class<T> clazz,
String labelString, T entity, int mode, int style) {
button_selection.setImage(ImageResources
.getImage(ImageResources.BROWSE_ICON));
button_selection.setToolTipText("Browse existing");
-
+
addControl(button_selection);
button_selection.addSelectionListener(this);
}
}
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
T selection = SelectionDialogFactory.getSelectionFromDialog(clazz, getShell(), getConversationHolder(), getEntity());
setSelectionInternal(selection);
}
-
+
/**
* Return the selected object
- *
+ *
* @return a T object.
*/
public T getSelection() {
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.forms.IEnableableFormElement#setEnabled(boolean)
*/
* <p>
* setSelectionInternal
* </p>
- *
+ *
* @param selection
* a T object.
*/
* <p>
* Setter for the field <code>entity</code>.
* </p>
- *
+ *
* @param selection
* a T object.
*/
}
}
- /**
- * <p>
- * updateFromWizard
- * </p>
- */
- protected void updateFromWizard() {
+ @Override
+ public void updateFromWizard() {
updateElement();
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
}
* <p>
* getTitle
* </p>
- *
+ *
* @return a {@link java.lang.String} object.
*/
protected String getTitle() {
/*
* (non-Javadoc)
- *
+ *
* @see eu.etaxonomy.taxeditor.forms.IEntityElement#getEntity()
*/
/**
* <p>
* Getter for the field <code>entity</code>.
* </p>
- *
+ *
* @return a T object.
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see eu.etaxonomy.taxeditor.forms.section.cdmdetail.ISelectableElement#
* getSelectionArbitrator()
*/
* <p>
* Getter for the field <code>selectionArbitrator</code>.
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
* object.
*/
/**
* Convenient access to current shell
- *
+ *
* @return a {@link org.eclipse.swt.widgets.Shell} object.
*/
- protected Shell getShell() {
+ @Override
+ public Shell getShell() {
return getLayoutComposite().getShell();
}
* <p>
* getConversationHolder
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
* object.
*/
* <p>
* Getter for the field <code>label</code>.
* </p>
- *
+ *
* @return a {@link java.lang.String} object.
*/
@Override
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.dialog.selection.NomenclaturalAuthorTeamSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
* <p>
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
* @author n.hoffmann
import eu.etaxonomy.cdm.model.common.MultilanguageTextHelper;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement;
// $Id$
/**
* Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
+ * 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.
*/
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.StoreUtil;
-import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
import eu.etaxonomy.taxeditor.ui.section.key.GeographicalScopeDetailSection;
* <p>
* CdmSectionPart class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Feb 8, 2010
* @version 1.0
* <p>
* Constructor for CdmSectionPart.
* </p>
- *
+ *
* @param section
* a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
* object.
if (input instanceof PolytomousKeyRelationship) {
input = ((PolytomousKeyRelationship) input).getDestination();
}
-
- if ((input instanceof PolytomousKeyNode) &&
- (formSection instanceof PolytomousKeyDetailSection ||
- formSection instanceof GeographicalScopeDetailSection ||
- formSection instanceof ScopeRestrictionSection ||
+
+ if ((input instanceof PolytomousKeyNode) &&
+ (formSection instanceof PolytomousKeyDetailSection ||
+ formSection instanceof GeographicalScopeDetailSection ||
+ formSection instanceof ScopeRestrictionSection ||
formSection instanceof TaxonomicScopeSection)) {
input = ((PolytomousKeyNode)input).getKey();
}
-
-
+
+
formSection.setEntity((T) input);
-
+
return true;
}
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse
* .jface.util.PropertyChangeEvent)
public void propertyChange(PropertyChangeEvent event) {
if (event != null) {
- Object eventSource = event.getSource();
-
+ Object eventSource = event.getSource();
+
if (formSection.equals(eventSource)){
markDirty();
}
if((
- (eventSource instanceof AbstractCdmFormElement)
- && formSection.containsFormElement((AbstractCdmFormElement) eventSource))
+ (eventSource instanceof ICdmFormElement)
+ && formSection.containsFormElement((ICdmFormElement) eventSource))
) {
markDirty();
}
-
// $Id$
/**
* Copyright (C) 2011 EDIT
- * European Distributed Institute of Taxonomy
+ * 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.
*/
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
-
import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationDetailsSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationGeneralSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.GatheringEventSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.DerivedUnitDetailsSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenDetailsSection;
+import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenGeneralSection;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.RootElement;
import eu.etaxonomy.taxeditor.ui.section.agent.PersonDetailSection;
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
import eu.etaxonomy.taxeditor.ui.section.name.TypeDesignationSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.GeneralDetailSection;
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
import eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessagesSection;
import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
/**
- *
+ *
* The DetailsViewer handles the content of the details view (
* {@link DetailsViewPart}).<br>
* Depending on the type of the selected element the section of the details view
*/
public class DetailsViewer extends AbstractCdmDataViewer {
- private ISelection selection;
-
- /**
- * <p>
- * Constructor for DetailsViewer.
- * </p>
- *
- * @param parent
- * a {@link org.eclipse.swt.widgets.Composite} object.
- * @param viewPart
- * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
- * object.
- */
- public DetailsViewer(Composite parent, AbstractCdmViewPart viewPart) {
- super(parent, viewPart);
- }
-
- // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
- // since we are getting implementations of DerivedUnitBase from the bulk
- // editor
- // and not derived unit facade objects,
-
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
- * .lang.Object)
- */
- @Override
- public void setInput(Object input) {
+ private ISelection selection;
+
+ /**
+ * <p>
+ * Constructor for DetailsViewer.
+ * </p>
+ *
+ * @param parent
+ * a {@link org.eclipse.swt.widgets.Composite} object.
+ * @param viewPart
+ * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
+ * object.
+ */
+ public DetailsViewer(Composite parent, AbstractCdmViewPart viewPart) {
+ super(parent, viewPart);
+ }
+
+ // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
+ // since we are getting implementations of DerivedUnitBase from the bulk
+ // editor
+ // and not derived unit facade objects,
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
+ * .lang.Object)
+ */
+ @Override
+ public void setInput(Object input) {
if (input instanceof DerivedUnit) {
- try {
- input = DerivedUnitFacade.NewInstance((DerivedUnit) input,
- PreferencesUtil.getDerivedUnitConfigurator());
- } catch (DerivedUnitFacadeNotSupportedException e) {
+ try {
+ input = DerivedUnitFacade.NewInstance((DerivedUnit) input,PreferencesUtil.getDerivedUnitConfigurator());
+ } catch (DerivedUnitFacadeNotSupportedException e) {
AbstractUtility.error(getClass(), e);
- }
+ }
+ }
+ else if(input instanceof FieldUnit){
+ input = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit) input,PreferencesUtil.getDerivedUnitConfigurator());
}
- super.setInput(input);
- }
+ super.setInput(input);
+ }
- @Override
- protected void markViewPartDirty() {
- if (getInput() instanceof DerivedUnitFacade) {
- getViewPart().changed(((DerivedUnitFacade) getInput()).innerDerivedUnit());
- }
+ @Override
+ protected void markViewPartDirty() {
+ if (getInput() instanceof DerivedUnitFacade) {
+ DerivedUnitFacade derivedUnitFacade = (DerivedUnitFacade) getInput();
+ DerivedUnit innerDerivedUnit = derivedUnitFacade.innerDerivedUnit();
+ FieldUnit innerFieldUnit = derivedUnitFacade.innerFieldUnit();
+ if(innerDerivedUnit!=null){
+ getViewPart().changed(innerDerivedUnit);
+ }
+ else if(innerFieldUnit!=null){
+ getViewPart().changed(innerFieldUnit);
+ }
+ }
+
+ super.markViewPartDirty();
+ }
+
+ // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
- super.markViewPartDirty();
- }
-
- // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.Viewer#refresh()
- */
- /** {@inheritDoc} */
- @Override
- protected void showParts() {
- // FIXME (CM) : Need to clean out this code.
- // Too much type checking to decide which detail view to display.
- // Need to build in a mechanism where navigators / editors are 'aware'
- // of the corresponding detail viewer.
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.Viewer#refresh()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected void showParts() {
+ // FIXME (CM) : Need to clean out this code.
+ // Too much type checking to decide which detail view to display.
+ // Need to build in a mechanism where navigators / editors are 'aware'
+ // of the corresponding detail viewer.
Object input = getInput();
if (input instanceof TaxonBase) {
- createTaxonSections(rootElement);
+ createTaxonSections(rootElement);
} else if (input instanceof NonViralName) {
- createNameSections(rootElement);
+ createNameSections(rootElement);
} else if (input instanceof Reference) {
- createReferenceSections(rootElement);
+ createReferenceSections(rootElement);
} else if (input instanceof Team) {
- createTeamDetailSection(rootElement);
+ createTeamDetailSection(rootElement);
} else if (input instanceof Person) {
- createPersonDetailSection(rootElement);
+ createPersonDetailSection(rootElement);
} else if (input instanceof TeamOrPersonBase) {
- createTeamOrPersonBaseDetailSection(rootElement);
+ createTeamOrPersonBaseDetailSection(rootElement);
} else if (input instanceof DescriptionBase) {
Set<Marker> descriptionMarkers = ((DescriptionBase) input).getMarkers();
MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(
UsageTermCollection.uuidUseMarkerType);
- Boolean isUseDescription = false;
- for (Marker marker : descriptionMarkers) {
- if (marker.getMarkerType().equals(useMarkertype)) {
- isUseDescription = true;
- }
- }
+ Boolean isUseDescription = false;
+ for (Marker marker : descriptionMarkers) {
+ if (marker.getMarkerType().equals(useMarkertype)) {
+ isUseDescription = true;
+ }
+ }
if (((DescriptionBase) input).isImageGallery()) {
- createImageGallerySection(rootElement);
+ createImageGallerySection(rootElement);
- } else if (isUseDescription) {
- createUseDescriptionSection(rootElement);
- } else {
- createDescriptionSection(rootElement);
+ } else if (isUseDescription) {
+ createUseDescriptionSection(rootElement);
+ } else {
+ createDescriptionSection(rootElement);
- }
+ }
} else if (input instanceof DescriptionElementBase) {
Set<Marker> descriptionMarkers = ((DescriptionElementBase) input).getInDescription().getMarkers();
MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(
UsageTermCollection.uuidUseMarkerType);
- Boolean isUseDescription = false;
- for (Marker marker : descriptionMarkers) {
- if (marker.getMarkerType().equals(useMarkertype)) {
- isUseDescription = true;
- }
- }
-
+ Boolean isUseDescription = false;
+ for (Marker marker : descriptionMarkers) {
+ if (marker.getMarkerType().equals(useMarkertype)) {
+ isUseDescription = true;
+ }
+ }
+
if (isUseDescription == true && input instanceof CategoricalData) {
- createUseRecordSection(rootElement);
+ createUseRecordSection(rootElement);
} else {
- createDescriptionElementSection(rootElement);
- }
+ createDescriptionElementSection(rootElement);
+ }
} else if (input instanceof Media) {
- createMediaElementSection(rootElement);
+ createMediaElementSection(rootElement);
} else if (input instanceof DerivedUnitFacade) {
- createDerivedUnitBaseElementSection(rootElement);
+ DerivedUnitFacade derivedUnitFacade = (DerivedUnitFacade)input;
+ if(derivedUnitFacade.getType()==SpecimenOrObservationType.FieldUnit){
+ createFieldObservationDetailsView(rootElement);
+ } else{
+ createSpecimenDetailsView(rootElement);
+ }
} else if (input instanceof FeatureNodeContainer) {
- createFeatureDistributionSection(rootElement);
+ createFeatureDistributionSection(rootElement);
} else if (input instanceof PolytomousKey) {
- //createPolytomousKeySection(rootElement);
+ // createPolytomousKeySection(rootElement);
} else if ((input instanceof PolytomousKeyNode) || (input instanceof PolytomousKeyRelationship)) {
- createPolytomousKeyNodeSection(rootElement);
+ createPolytomousKeyNodeSection(rootElement);
} else if (input instanceof User) {
- createUserSection(rootElement);
+ createUserSection(rootElement);
} else if (input instanceof Group) {
- createGroupSection(rootElement);
+ createGroupSection(rootElement);
} else if (input instanceof TaxonRelationship) {
- createTaxonRelationshipSection(rootElement);
+ createTaxonRelationshipSection(rootElement);
} else if (input instanceof TermVocabulary) {
- createTermVocabularySection(rootElement);
+ createTermVocabularySection(rootElement);
} else if (input instanceof DefinedTermBase) {
- createDefinedTermSection(rootElement);
- } else {
- destroySections();
- }
- layout();
- }
+ createDefinedTermSection(rootElement);
+ } else {
+ destroySections();
+ }
+ layout();
+ }
-
- /**
- * @param rootElement
- */
- private void createGroupSection(RootElement parent) {
- destroySections();
+ /**
+ * @param rootElement
+ */
+ private void createGroupSection(RootElement parent) {
+ destroySections();
GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(groupDetailSection);
- addPart(memberDetailSection);
- addPart(grantedAuthorityDetailSection);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.Viewer#getSelection()
- */
- /** {@inheritDoc} */
- @Override
- public ISelection getSelection() {
- return selection;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
- * .ISelection, boolean)
- */
- /** {@inheritDoc} */
- @Override
- public void setSelection(ISelection selection, boolean reveal) {
- this.selection = selection;
+ addPart(groupDetailSection);
+ addPart(memberDetailSection);
+ addPart(grantedAuthorityDetailSection);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.Viewer#getSelection()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public ISelection getSelection() {
+ return selection;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
+ * .ISelection, boolean)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void setSelection(ISelection selection, boolean reveal) {
+ this.selection = selection;
SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
- fireSelectionChanged(selectionChangedEvent);
- }
+ fireSelectionChanged(selectionChangedEvent);
+ }
- /**
- * createTaxonSections(RootElement parent)
+ /**
+ * createTaxonSections(RootElement parent)
*
- * @param parent
- */
- private void createTaxonSections(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createTaxonSections(RootElement parent) {
+ destroySections();
TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
| ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this, ExpandableComposite.EXPANDED);
- addPart(taxonBaseDetailSection);
- addPart(nonViralNameSection);
- addPart(nomenclaturalStatusSection);
- addPart(protologSection);
- addPart(referenceDetailSection);
- addPart(typeDesignationSection);
- addPart(nameRelationshipSection);
- addPart(parsingMessagesSection);
- }
-
- /**
- * createNameSections
+ addPart(taxonBaseDetailSection);
+ addPart(nonViralNameSection);
+ addPart(nomenclaturalStatusSection);
+ addPart(protologSection);
+ addPart(referenceDetailSection);
+ addPart(typeDesignationSection);
+ addPart(nameRelationshipSection);
+ addPart(parsingMessagesSection);
+ }
+
+ /**
+ * createNameSections
*
- * @param parent
- */
- private void createNameSections(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createNameSections(RootElement parent) {
+ destroySections();
NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- addPart(nonViralNameSection);
- addPart(nomenclaturalStatusSection);
- addPart(protologSection);
- addPart(referenceDetailSection);
- addPart(typeDesignationSection);
- addPart(nameRelationshipSection);
- }
+ addPart(nonViralNameSection);
+ addPart(nomenclaturalStatusSection);
+ addPart(protologSection);
+ addPart(referenceDetailSection);
+ addPart(typeDesignationSection);
+ addPart(nameRelationshipSection);
+ }
- /**
- * createReferenceSections
+ /**
+ * createReferenceSections
*
- * @param parent
- */
- private void createReferenceSections(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createReferenceSections(RootElement parent) {
+ destroySections();
ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(referenceDetailSection);
- }
+ addPart(referenceDetailSection);
+ }
- /**
- * createTeamOrPersonBaseDetailSection
+ /**
+ * createTeamOrPersonBaseDetailSection
*
- * @param parent
- */
- private void createTeamOrPersonBaseDetailSection(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createTeamOrPersonBaseDetailSection(RootElement parent) {
+ destroySections();
TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(teamOrPersonBaseDetailSection);
- }
+ addPart(teamOrPersonBaseDetailSection);
+ }
- /**
- * createTeamDetailSection
+ /**
+ * createTeamDetailSection
*
- * @param parent
- */
- private void createTeamDetailSection(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createTeamDetailSection(RootElement parent) {
+ destroySections();
TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(teamDetailSection);
- }
-
- /**
- * createPersonDetailSection
+ addPart(teamDetailSection);
+ }
+
+ /**
+ * createPersonDetailSection
*
- * @param parent
- */
- private void createPersonDetailSection(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createPersonDetailSection(RootElement parent) {
+ destroySections();
PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(personDetailSection);
- }
+ addPart(personDetailSection);
+ }
- /**
- * createDescriptionElementSection
+ /**
+ * createDescriptionElementSection
*
- * @param parent
- */
- private void createDescriptionElementSection(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createDescriptionElementSection(RootElement parent) {
+ destroySections();
DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
DescriptionElementSourceSection descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- addPart(descriptionElementDetailSection);
- addPart(descriptionElementSourceSection);
- addPart(descriptionElementMediaSection);
- }
+ addPart(descriptionElementDetailSection);
+ addPart(descriptionElementSourceSection);
+ addPart(descriptionElementMediaSection);
+ }
- /**
- * createDescriptionSection
+ /**
+ * createDescriptionSection
*
- * @param parent
- */
- private void createDescriptionSection(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createDescriptionSection(RootElement parent) {
+ destroySections();
DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NaturalLanguageSection naturalLanguageSection = formFactory.createNaturalLanguageSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-// DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
-// .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
-// getConversationHolder(), parent, Section.TWISTIE);
+// DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
//
-// formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+// formFactory.createHorizontalSeparator(parent, SWT.BORDER);
ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- addPart(descriptionDetailSection);
- addPart(naturalLanguageSection);
- addPart(describedSpecimenSection);
-// addPart(descriptionSourceSection);
- addPart(scopeSection);
- }
-
- /**
- * Creates the use Description section
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ addPart(descriptionDetailSection);
+ addPart(naturalLanguageSection);
+ addPart(describedSpecimenSection);
+// addPart(descriptionSourceSection);
+ addPart(scopeSection);
+ }
+
+ /**
+ * Creates the use Description section
*
- * @param parent
- */
- private void createUseDescriptionSection(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createUseDescriptionSection(RootElement parent) {
+ destroySections();
DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- addPart(descriptionDetailSection);
- addPart(descriptionSourceSection);
-
- }
+ addPart(descriptionDetailSection);
+ addPart(descriptionSourceSection);
+ }
- /**
- * @param rootElement
- */
- private void createImageGallerySection(RootElement parent) {
- destroySections();
+ /**
+ * @param rootElement
+ */
+ private void createImageGallerySection(RootElement parent) {
+ destroySections();
DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(descriptionDetailSection);
- }
-
- /**
- * createMediaElementSection
+ addPart(descriptionDetailSection);
+ }
+
+ /**
+ * createMediaElementSection
*
- * @param parent
- */
+ * @param parent
+ */
- private void createMediaElementSection(RootElement parent) {
- destroySections();
+ private void createMediaElementSection(RootElement parent) {
+ destroySections();
MediaDetailsSection mediaDetailSection = formFactory.createMediaDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(mediaDetailSection);
- }
+ addPart(mediaDetailSection);
+ }
- /**
- * createDerivedUnitBaseElementSection
+ /**
+ * createDerivedUnitBaseElementSection
*
- * @param parent
- */
- private void createDerivedUnitBaseElementSection(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createFieldObservationDetailsView(RootElement parent) {
+ destroySections();
- GeneralDetailSection generalDetailSection = formFactory.createGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ FieldObservationGeneralSection fieldObservationSection = formFactory.createFieldObservationGeneralSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+ GatheringEventSection gatheringEventDetailSection = formFactory.createGatheringEventSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- FieldObservationDetailSection fieldObservationDetailSection = formFactory.createFieldObservationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+ FieldObservationDetailsSection fieldObservationDetailSection = formFactory.createFieldObservationDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+// DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+//
+// formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+//
+// DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ addPart(fieldObservationSection);
+ addPart(gatheringEventDetailSection);
+ addPart(fieldObservationDetailSection);
+// addPart(derivedUnitBaseDetailSection);
+// addPart(determinationDetailSection);
+ }
- DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+ /**
+ * createDerivedUnitBaseElementSection
+ *
+ * @param parent
+ */
+ private void createSpecimenDetailsView(RootElement parent) {
+ destroySections();
- addPart(generalDetailSection);
- addPart(gatheringEventDetailSection);
- addPart(fieldObservationDetailSection);
- addPart(derivedUnitBaseDetailSection);
- addPart(determinationDetailSection);
+ SpecimenGeneralSection specimenSection = formFactory.createSpecimenSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- }
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ SpecimenDetailsSection specimenDetailsSection = formFactory.createSpecimenDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ DerivedUnitDetailsSection derivedUnitDetailsSection = formFactory.createDerivedUnitDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+
+ addPart(specimenSection);
+ addPart(specimenDetailsSection);
+ addPart(derivedUnitDetailsSection);
+ }
- /**
- * @param rootElement
- */
- private void createFeatureDistributionSection(RootElement parent) {
- destroySections();
+ /**
+ * @param rootElement
+ */
+ private void createFeatureDistributionSection(RootElement parent) {
+ destroySections();
FeatureDistributionDetailSection featureDistributionSection = formFactory.createFeatureDistributionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(featureDistributionSection);
- }
+ addPart(featureDistributionSection);
+ }
- /**
- * createPolytomousKeyNodeSection
+ /**
+ * createPolytomousKeyNodeSection
*
- * @param parent
- */
- private void createPolytomousKeyNodeSection(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createPolytomousKeyNodeSection(RootElement parent) {
+ destroySections();
PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
-
+
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
+
PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = formFactory.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
TaxonomicScopeSection taxonomicScopeSection = formFactory.createTaxonomicScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
- addPart(polytomousKeyDetailSection);
- addPart(polytomousKeyNodeDetailSection);
- addPart(taxonomicScopeSection);
+ addPart(polytomousKeyDetailSection);
+ addPart(polytomousKeyNodeDetailSection);
+ addPart(taxonomicScopeSection);
+
+ }
- }
-
- /**
- * create the UseRecordSection
+ /**
+ * create the UseRecordSection
*
- * @param parent
- */
- private void createUseRecordSection(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createUseRecordSection(RootElement parent) {
+ destroySections();
UseRecordDetailSection descriptionUseRecordSection = formFactory.createUseRecordDetailSection(getConversationHolder(), parent, this,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- addPart(descriptionUseRecordSection);
-
-
- }
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ addPart(descriptionUseRecordSection);
+
+ }
- /**
- * createUserSection
+ /**
+ * createUserSection
*
- * @param parent
- */
- private void createUserSection(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createUserSection(RootElement parent) {
+ destroySections();
UserDetailSection userDetailSection = formFactory.createUserDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
GroupsByUserDetailSection groupByUserDetailSection = formFactory.createGroupsByUserDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(userDetailSection);
- addPart(groupByUserDetailSection);
- }
+ addPart(userDetailSection);
+ addPart(groupByUserDetailSection);
+ }
- /**
- * createTaxonRelationshipSection
+ /**
+ * createTaxonRelationshipSection
*
- * @param parent
- */
- private void createTaxonRelationshipSection(RootElement parent) {
- destroySections();
+ * @param parent
+ */
+ private void createTaxonRelationshipSection(RootElement parent) {
+ destroySections();
TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(taxonRelationshipDetailSection);
- addPart(referencedEntityBaseDetailSection);
- }
+ addPart(taxonRelationshipDetailSection);
+ addPart(referencedEntityBaseDetailSection);
+ }
- /**
- * @param rootElement
- */
- private void createTermVocabularySection(RootElement parent) {
- destroySections();
+ /**
+ * @param rootElement
+ */
+ private void createTermVocabularySection(RootElement parent) {
+ destroySections();
TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(termVocabularyDetailSection);
- }
+ addPart(termVocabularyDetailSection);
+ }
- /**
- * createDefinedTermSection
+ /**
+ * createDefinedTermSection
*
- * @param parent
- */
- private void createDefinedTermSection(RootElement parent) {
- destroySections();
-
- AbstractFormSection definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(definedTermDetailSection);
- }
-
- private void createFODetailsView(RootElement parent) {
+ * @param parent
+ */
+ private void createDefinedTermSection(RootElement parent) {
destroySections();
- GeneralDetailSection generalDetailSection = formFactory.createFOSection(getConversationHolder(), parent, this,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- FieldObservationDetailSection fieldObservationDetailSection = formFactory.createFODetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
- addPart(generalDetailSection);
- addPart(gatheringEventDetailSection);
- addPart(fieldObservationDetailSection);
+ AbstractFormSection definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ addPart(definedTermDetailSection);
}
}
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2011 Google, Inc.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Google, Inc. - initial API and implementation\r
+ *******************************************************************************/\r
+package org.eclipse.wb.swt;
+
+import java.io.File;
+import java.io.InputStream;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.CompositeImageDescriptor;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.osgi.framework.Bundle;
+
+/**
+ * Utility class for managing OS resources associated with SWT/JFace controls such as colors, fonts, images,
+ * etc.
+ *
+ * !!! IMPORTANT !!! Application code must explicitly invoke the <code>dispose()</code> method to release the
+ * operating system resources managed by cached objects when those objects and OS resources are no longer
+ * needed (e.g. on application shutdown)
+ *
+ * This class may be freely distributed as part of any application or plugin.
+ * <p>
+ *
+ * @author scheglov_ke
+ * @author Dan Rubel
+ */
+public class ResourceManager extends SWTResourceManager {
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Image
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ private static Map<ImageDescriptor, Image> m_descriptorImageMap = new HashMap<ImageDescriptor, Image>();
+ /**
+ * Returns an {@link ImageDescriptor} stored in the file at the specified path relative to the specified
+ * class.
+ *
+ * @param clazz
+ * the {@link Class} relative to which to find the image descriptor.
+ * @param path
+ * the path to the image file.
+ * @return the {@link ImageDescriptor} stored in the file at the specified path.
+ */
+ public static ImageDescriptor getImageDescriptor(Class<?> clazz, String path) {
+ return ImageDescriptor.createFromFile(clazz, path);
+ }
+ /**
+ * Returns an {@link ImageDescriptor} stored in the file at the specified path.
+ *
+ * @param path
+ * the path to the image file.
+ * @return the {@link ImageDescriptor} stored in the file at the specified path.
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ try {
+ return ImageDescriptor.createFromURL(new File(path).toURI().toURL());
+ } catch (MalformedURLException e) {
+ return null;
+ }
+ }
+ /**
+ * Returns an {@link Image} based on the specified {@link ImageDescriptor}.
+ *
+ * @param descriptor
+ * the {@link ImageDescriptor} for the {@link Image}.
+ * @return the {@link Image} based on the specified {@link ImageDescriptor}.
+ */
+ public static Image getImage(ImageDescriptor descriptor) {
+ if (descriptor == null) {
+ return null;
+ }
+ Image image = m_descriptorImageMap.get(descriptor);
+ if (image == null) {
+ image = descriptor.createImage();
+ m_descriptorImageMap.put(descriptor, image);
+ }
+ return image;
+ }
+ /**
+ * Maps images to decorated images.
+ */
+ @SuppressWarnings("unchecked")
+ private static Map<Image, Map<Image, Image>>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY];
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated.
+ * @param decorator
+ * the {@link Image} to decorate the base image.
+ * @return {@link Image} The resulting decorated image.
+ */
+ public static Image decorateImage(Image baseImage, Image decorator) {
+ return decorateImage(baseImage, decorator, BOTTOM_RIGHT);
+ }
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated.
+ * @param decorator
+ * the {@link Image} to decorate the base image.
+ * @param corner
+ * the corner to place decorator image.
+ * @return the resulting decorated {@link Image}.
+ */
+ public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) {
+ if (corner <= 0 || corner >= LAST_CORNER_KEY) {
+ throw new IllegalArgumentException("Wrong decorate corner");
+ }
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[corner];
+ if (cornerDecoratedImageMap == null) {
+ cornerDecoratedImageMap = new HashMap<Image, Map<Image, Image>>();
+ m_decoratedImageMap[corner] = cornerDecoratedImageMap;
+ }
+ Map<Image, Image> decoratedMap = cornerDecoratedImageMap.get(baseImage);
+ if (decoratedMap == null) {
+ decoratedMap = new HashMap<Image, Image>();
+ cornerDecoratedImageMap.put(baseImage, decoratedMap);
+ }
+ //
+ Image result = decoratedMap.get(decorator);
+ if (result == null) {
+ final Rectangle bib = baseImage.getBounds();
+ final Rectangle dib = decorator.getBounds();
+ final Point baseImageSize = new Point(bib.width, bib.height);
+ CompositeImageDescriptor compositImageDesc = new CompositeImageDescriptor() {
+ @Override
+ protected void drawCompositeImage(int width, int height) {
+ drawImage(baseImage.getImageData(), 0, 0);
+ if (corner == TOP_LEFT) {
+ drawImage(decorator.getImageData(), 0, 0);
+ } else if (corner == TOP_RIGHT) {
+ drawImage(decorator.getImageData(), bib.width - dib.width, 0);
+ } else if (corner == BOTTOM_LEFT) {
+ drawImage(decorator.getImageData(), 0, bib.height - dib.height);
+ } else if (corner == BOTTOM_RIGHT) {
+ drawImage(decorator.getImageData(), bib.width - dib.width, bib.height - dib.height);
+ }
+ }
+ @Override
+ protected Point getSize() {
+ return baseImageSize;
+ }
+ };
+ //
+ result = compositImageDesc.createImage();
+ decoratedMap.put(decorator, result);
+ }
+ return result;
+ }
+ /**
+ * Dispose all of the cached images.
+ */
+ public static void disposeImages() {
+ SWTResourceManager.disposeImages();
+ // dispose ImageDescriptor images
+ {
+ for (Iterator<Image> I = m_descriptorImageMap.values().iterator(); I.hasNext();) {
+ I.next().dispose();
+ }
+ m_descriptorImageMap.clear();
+ }
+ // dispose decorated images
+ for (int i = 0; i < m_decoratedImageMap.length; i++) {
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i];
+ if (cornerDecoratedImageMap != null) {
+ for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) {
+ for (Image image : decoratedMap.values()) {
+ image.dispose();
+ }
+ decoratedMap.clear();
+ }
+ cornerDecoratedImageMap.clear();
+ }
+ }
+ // dispose plugin images
+ {
+ for (Iterator<Image> I = m_URLImageMap.values().iterator(); I.hasNext();) {
+ I.next().dispose();
+ }
+ m_URLImageMap.clear();
+ }
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Plugin images support
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps URL to images.
+ */
+ private static Map<String, Image> m_URLImageMap = new HashMap<String, Image>();
+ /**
+ * Provider for plugin resources, used by WindowBuilder at design time.
+ */
+ public interface PluginResourceProvider {
+ URL getEntry(String symbolicName, String path);
+ }
+ /**
+ * Instance of {@link PluginResourceProvider}, used by WindowBuilder at design time.
+ */
+ private static PluginResourceProvider m_designTimePluginResourceProvider = null;
+ /**
+ * Returns an {@link Image} based on a plugin and file path.
+ *
+ * @param plugin
+ * the plugin {@link Object} containing the image
+ * @param name
+ * the path to the image within the plugin
+ * @return the {@link Image} stored in the file at the specified path
+ *
+ * @deprecated Use {@link #getPluginImage(String, String)} instead.
+ */
+ @Deprecated
+ public static Image getPluginImage(Object plugin, String name) {
+ try {
+ URL url = getPluginImageURL(plugin, name);
+ if (url != null) {
+ return getPluginImageFromUrl(url);
+ }
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ return null;
+ }
+ /**
+ * Returns an {@link Image} based on a {@link Bundle} and resource entry path.
+ *
+ * @param symbolicName
+ * the symbolic name of the {@link Bundle}.
+ * @param path
+ * the path of the resource entry.
+ * @return the {@link Image} stored in the file at the specified path.
+ */
+ public static Image getPluginImage(String symbolicName, String path) {
+ try {
+ URL url = getPluginImageURL(symbolicName, path);
+ if (url != null) {
+ return getPluginImageFromUrl(url);
+ }
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ return null;
+ }
+ /**
+ * Returns an {@link Image} based on given {@link URL}.
+ */
+ private static Image getPluginImageFromUrl(URL url) {
+ try {
+ try {
+ String key = url.toExternalForm();
+ Image image = m_URLImageMap.get(key);
+ if (image == null) {
+ InputStream stream = url.openStream();
+ try {
+ image = getImage(stream);
+ m_URLImageMap.put(key, image);
+ } finally {
+ stream.close();
+ }
+ }
+ return image;
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ return null;
+ }
+ /**
+ * Returns an {@link ImageDescriptor} based on a plugin and file path.
+ *
+ * @param plugin
+ * the plugin {@link Object} containing the image.
+ * @param name
+ * the path to th eimage within the plugin.
+ * @return the {@link ImageDescriptor} stored in the file at the specified path.
+ *
+ * @deprecated Use {@link #getPluginImageDescriptor(String, String)} instead.
+ */
+ @Deprecated
+ public static ImageDescriptor getPluginImageDescriptor(Object plugin, String name) {
+ try {
+ try {
+ URL url = getPluginImageURL(plugin, name);
+ return ImageDescriptor.createFromURL(url);
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ return null;
+ }
+ /**
+ * Returns an {@link ImageDescriptor} based on a {@link Bundle} and resource entry path.
+ *
+ * @param symbolicName
+ * the symbolic name of the {@link Bundle}.
+ * @param path
+ * the path of the resource entry.
+ * @return the {@link ImageDescriptor} based on a {@link Bundle} and resource entry path.
+ */
+ public static ImageDescriptor getPluginImageDescriptor(String symbolicName, String path) {
+ try {
+ URL url = getPluginImageURL(symbolicName, path);
+ if (url != null) {
+ return ImageDescriptor.createFromURL(url);
+ }
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ return null;
+ }
+ /**
+ * Returns an {@link URL} based on a {@link Bundle} and resource entry path.
+ */
+ private static URL getPluginImageURL(String symbolicName, String path) {
+ // try runtime plugins
+ {
+ Bundle bundle = Platform.getBundle(symbolicName);
+ if (bundle != null) {
+ return bundle.getEntry(path);
+ }
+ }
+ // try design time provider
+ if (m_designTimePluginResourceProvider != null) {
+ return m_designTimePluginResourceProvider.getEntry(symbolicName, path);
+ }
+ // no such resource
+ return null;
+ }
+ /**
+ * Returns an {@link URL} based on a plugin and file path.
+ *
+ * @param plugin
+ * the plugin {@link Object} containing the file path.
+ * @param name
+ * the file path.
+ * @return the {@link URL} representing the file at the specified path.
+ * @throws Exception
+ */
+ private static URL getPluginImageURL(Object plugin, String name) throws Exception {
+ // try to work with 'plugin' as with OSGI BundleContext
+ try {
+ Class<?> BundleClass = Class.forName("org.osgi.framework.Bundle"); //$NON-NLS-1$
+ Class<?> BundleContextClass = Class.forName("org.osgi.framework.BundleContext"); //$NON-NLS-1$
+ if (BundleContextClass.isAssignableFrom(plugin.getClass())) {
+ Method getBundleMethod = BundleContextClass.getMethod("getBundle", new Class[0]); //$NON-NLS-1$
+ Object bundle = getBundleMethod.invoke(plugin, new Object[0]);
+ //
+ Class<?> PathClass = Class.forName("org.eclipse.core.runtime.Path"); //$NON-NLS-1$
+ Constructor<?> pathConstructor = PathClass.getConstructor(new Class[]{String.class});
+ Object path = pathConstructor.newInstance(new Object[]{name});
+ //
+ Class<?> IPathClass = Class.forName("org.eclipse.core.runtime.IPath"); //$NON-NLS-1$
+ Class<?> PlatformClass = Class.forName("org.eclipse.core.runtime.Platform"); //$NON-NLS-1$
+ Method findMethod = PlatformClass.getMethod("find", new Class[]{BundleClass, IPathClass}); //$NON-NLS-1$
+ return (URL) findMethod.invoke(null, new Object[]{bundle, path});
+ }
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ // else work with 'plugin' as with usual Eclipse plugin
+ {
+ Class<?> PluginClass = Class.forName("org.eclipse.core.runtime.Plugin"); //$NON-NLS-1$
+ if (PluginClass.isAssignableFrom(plugin.getClass())) {
+ //
+ Class<?> PathClass = Class.forName("org.eclipse.core.runtime.Path"); //$NON-NLS-1$
+ Constructor<?> pathConstructor = PathClass.getConstructor(new Class[]{String.class});
+ Object path = pathConstructor.newInstance(new Object[]{name});
+ //
+ Class<?> IPathClass = Class.forName("org.eclipse.core.runtime.IPath"); //$NON-NLS-1$
+ Method findMethod = PluginClass.getMethod("find", new Class[]{IPathClass}); //$NON-NLS-1$
+ return (URL) findMethod.invoke(plugin, new Object[]{path});
+ }
+ }
+ return null;
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // General
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Dispose of cached objects and their underlying OS resources. This should only be called when the cached
+ * objects are no longer needed (e.g. on application shutdown).
+ */
+ public static void dispose() {
+ disposeColors();
+ disposeFonts();
+ disposeImages();
+ }
+}
\ No newline at end of file
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2011 Google, Inc.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Google, Inc. - initial API and implementation\r
+ *******************************************************************************/\r
+package org.eclipse.wb.swt;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc.
+ * <p>
+ * !!! IMPORTANT !!! Application code must explicitly invoke the <code>dispose()</code> method to release the
+ * operating system resources managed by cached objects when those objects and OS resources are no longer
+ * needed (e.g. on application shutdown)
+ * <p>
+ * This class may be freely distributed as part of any application or plugin.
+ * <p>
+ * @author scheglov_ke
+ * @author Dan Rubel
+ */
+public class SWTResourceManager {
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Color
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ private static Map<RGB, Color> m_colorMap = new HashMap<RGB, Color>();
+ /**
+ * Returns the system {@link Color} matching the specific ID.
+ *
+ * @param systemColorID
+ * the ID value for the color
+ * @return the system {@link Color} matching the specific ID
+ */
+ public static Color getColor(int systemColorID) {
+ Display display = Display.getCurrent();
+ return display.getSystemColor(systemColorID);
+ }
+ /**
+ * Returns a {@link Color} given its red, green and blue component values.
+ *
+ * @param r
+ * the red component of the color
+ * @param g
+ * the green component of the color
+ * @param b
+ * the blue component of the color
+ * @return the {@link Color} matching the given red, green and blue component values
+ */
+ public static Color getColor(int r, int g, int b) {
+ return getColor(new RGB(r, g, b));
+ }
+ /**
+ * Returns a {@link Color} given its RGB value.
+ *
+ * @param rgb
+ * the {@link RGB} value of the color
+ * @return the {@link Color} matching the RGB value
+ */
+ public static Color getColor(RGB rgb) {
+ Color color = m_colorMap.get(rgb);
+ if (color == null) {
+ Display display = Display.getCurrent();
+ color = new Color(display, rgb);
+ m_colorMap.put(rgb, color);
+ }
+ return color;
+ }
+ /**
+ * Dispose of all the cached {@link Color}'s.
+ */
+ public static void disposeColors() {
+ for (Color color : m_colorMap.values()) {
+ color.dispose();
+ }
+ m_colorMap.clear();
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Image
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps image paths to images.
+ */
+ private static Map<String, Image> m_imageMap = new HashMap<String, Image>();
+ /**
+ * Returns an {@link Image} encoded by the specified {@link InputStream}.
+ *
+ * @param stream
+ * the {@link InputStream} encoding the image data
+ * @return the {@link Image} encoded by the specified input stream
+ */
+ protected static Image getImage(InputStream stream) throws IOException {
+ try {
+ Display display = Display.getCurrent();
+ ImageData data = new ImageData(stream);
+ if (data.transparentPixel > 0) {
+ return new Image(display, data, data.getTransparencyMask());
+ }
+ return new Image(display, data);
+ } finally {
+ stream.close();
+ }
+ }
+ /**
+ * Returns an {@link Image} stored in the file at the specified path.
+ *
+ * @param path
+ * the path to the image file
+ * @return the {@link Image} stored in the file at the specified path
+ */
+ public static Image getImage(String path) {
+ Image image = m_imageMap.get(path);
+ if (image == null) {
+ try {
+ image = getImage(new FileInputStream(path));
+ m_imageMap.put(path, image);
+ } catch (Exception e) {
+ image = getMissingImage();
+ m_imageMap.put(path, image);
+ }
+ }
+ return image;
+ }
+ /**
+ * Returns an {@link Image} stored in the file at the specified path relative to the specified class.
+ *
+ * @param clazz
+ * the {@link Class} relative to which to find the image
+ * @param path
+ * the path to the image file, if starts with <code>'/'</code>
+ * @return the {@link Image} stored in the file at the specified path
+ */
+ public static Image getImage(Class<?> clazz, String path) {
+ String key = clazz.getName() + '|' + path;
+ Image image = m_imageMap.get(key);
+ if (image == null) {
+ try {
+ image = getImage(clazz.getResourceAsStream(path));
+ m_imageMap.put(key, image);
+ } catch (Exception e) {
+ image = getMissingImage();
+ m_imageMap.put(key, image);
+ }
+ }
+ return image;
+ }
+ private static final int MISSING_IMAGE_SIZE = 10;
+ /**
+ * @return the small {@link Image} that can be used as placeholder for missing image.
+ */
+ private static Image getMissingImage() {
+ Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
+ //
+ GC gc = new GC(image);
+ gc.setBackground(getColor(SWT.COLOR_RED));
+ gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
+ gc.dispose();
+ //
+ return image;
+ }
+ /**
+ * Style constant for placing decorator image in top left corner of base image.
+ */
+ public static final int TOP_LEFT = 1;
+ /**
+ * Style constant for placing decorator image in top right corner of base image.
+ */
+ public static final int TOP_RIGHT = 2;
+ /**
+ * Style constant for placing decorator image in bottom left corner of base image.
+ */
+ public static final int BOTTOM_LEFT = 3;
+ /**
+ * Style constant for placing decorator image in bottom right corner of base image.
+ */
+ public static final int BOTTOM_RIGHT = 4;
+ /**
+ * Internal value.
+ */
+ protected static final int LAST_CORNER_KEY = 5;
+ /**
+ * Maps images to decorated images.
+ */
+ @SuppressWarnings("unchecked")
+ private static Map<Image, Map<Image, Image>>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY];
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated
+ * @param decorator
+ * the {@link Image} to decorate the base image
+ * @return {@link Image} The resulting decorated image
+ */
+ public static Image decorateImage(Image baseImage, Image decorator) {
+ return decorateImage(baseImage, decorator, BOTTOM_RIGHT);
+ }
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated
+ * @param decorator
+ * the {@link Image} to decorate the base image
+ * @param corner
+ * the corner to place decorator image
+ * @return the resulting decorated {@link Image}
+ */
+ public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) {
+ if (corner <= 0 || corner >= LAST_CORNER_KEY) {
+ throw new IllegalArgumentException("Wrong decorate corner");
+ }
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[corner];
+ if (cornerDecoratedImageMap == null) {
+ cornerDecoratedImageMap = new HashMap<Image, Map<Image, Image>>();
+ m_decoratedImageMap[corner] = cornerDecoratedImageMap;
+ }
+ Map<Image, Image> decoratedMap = cornerDecoratedImageMap.get(baseImage);
+ if (decoratedMap == null) {
+ decoratedMap = new HashMap<Image, Image>();
+ cornerDecoratedImageMap.put(baseImage, decoratedMap);
+ }
+ //
+ Image result = decoratedMap.get(decorator);
+ if (result == null) {
+ Rectangle bib = baseImage.getBounds();
+ Rectangle dib = decorator.getBounds();
+ //
+ result = new Image(Display.getCurrent(), bib.width, bib.height);
+ //
+ GC gc = new GC(result);
+ gc.drawImage(baseImage, 0, 0);
+ if (corner == TOP_LEFT) {
+ gc.drawImage(decorator, 0, 0);
+ } else if (corner == TOP_RIGHT) {
+ gc.drawImage(decorator, bib.width - dib.width, 0);
+ } else if (corner == BOTTOM_LEFT) {
+ gc.drawImage(decorator, 0, bib.height - dib.height);
+ } else if (corner == BOTTOM_RIGHT) {
+ gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height);
+ }
+ gc.dispose();
+ //
+ decoratedMap.put(decorator, result);
+ }
+ return result;
+ }
+ /**
+ * Dispose all of the cached {@link Image}'s.
+ */
+ public static void disposeImages() {
+ // dispose loaded images
+ {
+ for (Image image : m_imageMap.values()) {
+ image.dispose();
+ }
+ m_imageMap.clear();
+ }
+ // dispose decorated images
+ for (int i = 0; i < m_decoratedImageMap.length; i++) {
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i];
+ if (cornerDecoratedImageMap != null) {
+ for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) {
+ for (Image image : decoratedMap.values()) {
+ image.dispose();
+ }
+ decoratedMap.clear();
+ }
+ cornerDecoratedImageMap.clear();
+ }
+ }
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Font
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps font names to fonts.
+ */
+ private static Map<String, Font> m_fontMap = new HashMap<String, Font>();
+ /**
+ * Maps fonts to their bold versions.
+ */
+ private static Map<Font, Font> m_fontToBoldFontMap = new HashMap<Font, Font>();
+ /**
+ * Returns a {@link Font} based on its name, height and style.
+ *
+ * @param name
+ * the name of the font
+ * @param height
+ * the height of the font
+ * @param style
+ * the style of the font
+ * @return {@link Font} The font matching the name, height and style
+ */
+ public static Font getFont(String name, int height, int style) {
+ return getFont(name, height, style, false, false);
+ }
+ /**
+ * Returns a {@link Font} based on its name, height and style. Windows-specific strikeout and underline
+ * flags are also supported.
+ *
+ * @param name
+ * the name of the font
+ * @param size
+ * the size of the font
+ * @param style
+ * the style of the font
+ * @param strikeout
+ * the strikeout flag (warning: Windows only)
+ * @param underline
+ * the underline flag (warning: Windows only)
+ * @return {@link Font} The font matching the name, height, style, strikeout and underline
+ */
+ public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) {
+ String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline;
+ Font font = m_fontMap.get(fontName);
+ if (font == null) {
+ FontData fontData = new FontData(name, size, style);
+ if (strikeout || underline) {
+ try {
+ Class<?> logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$
+ Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$
+ if (logFont != null && logFontClass != null) {
+ if (strikeout) {
+ logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
+ }
+ if (underline) {
+ logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
+ }
+ }
+ } catch (Throwable e) {
+ System.err.println("Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ font = new Font(Display.getCurrent(), fontData);
+ m_fontMap.put(fontName, font);
+ }
+ return font;
+ }
+ /**
+ * Returns a bold version of the given {@link Font}.
+ *
+ * @param baseFont
+ * the {@link Font} for which a bold version is desired
+ * @return the bold version of the given {@link Font}
+ */
+ public static Font getBoldFont(Font baseFont) {
+ Font font = m_fontToBoldFontMap.get(baseFont);
+ if (font == null) {
+ FontData fontDatas[] = baseFont.getFontData();
+ FontData data = fontDatas[0];
+ font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD);
+ m_fontToBoldFontMap.put(baseFont, font);
+ }
+ return font;
+ }
+ /**
+ * Dispose all of the cached {@link Font}'s.
+ */
+ public static void disposeFonts() {
+ // clear fonts
+ for (Font font : m_fontMap.values()) {
+ font.dispose();
+ }
+ m_fontMap.clear();
+ // clear bold fonts
+ for (Font font : m_fontToBoldFontMap.values()) {
+ font.dispose();
+ }
+ m_fontToBoldFontMap.clear();
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Cursor
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps IDs to cursors.
+ */
+ private static Map<Integer, Cursor> m_idToCursorMap = new HashMap<Integer, Cursor>();
+ /**
+ * Returns the system cursor matching the specific ID.
+ *
+ * @param id
+ * int The ID value for the cursor
+ * @return Cursor The system cursor matching the specific ID
+ */
+ public static Cursor getCursor(int id) {
+ Integer key = Integer.valueOf(id);
+ Cursor cursor = m_idToCursorMap.get(key);
+ if (cursor == null) {
+ cursor = new Cursor(Display.getDefault(), id);
+ m_idToCursorMap.put(key, cursor);
+ }
+ return cursor;
+ }
+ /**
+ * Dispose all of the cached cursors.
+ */
+ public static void disposeCursors() {
+ for (Cursor cursor : m_idToCursorMap.values()) {
+ cursor.dispose();
+ }
+ m_idToCursorMap.clear();
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // General
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Dispose of cached objects and their underlying OS resources. This should only be called when the cached
+ * objects are no longer needed (e.g. on application shutdown).
+ */
+ public static void dispose() {
+ disposeColors();
+ disposeImages();
+ disposeFonts();
+ disposeCursors();
+ }
+}
\ No newline at end of file